{"id":150,"hash":"255f4cfdc02a5490eb8f4e0e503856cd3e270ae4dbcc2dfab2f5912c24e38d14","pattern":"&lt;button onClick={}&gt; Event handlers cannot be passed to Client Component props","full_message":"Error: Event handlers cannot be passed to Client Component props.\n\n^^^^^^^^^^\nIf you need interactivity, consider converting part of this to a Client Component.\n\nconst reqHelp = () => {\n    Swal.fire({\n        title: '1',\n        text: '1',\n        icon: 'warning',\n        showCancelButton: true,\n        confirmButtonColor: '#3085d6',\n        cancelButtonColor: '#d33',\n        confirmButtonText: 'Yes',\n        cancelButtonText: 'No',\n    })\n}\n\nreturn(\n        <div className=\"buttons\">\n            <button onClick={reqHelp} className=\"stopwatchButton\">Request Help</button>\n        </div>\n);\n\nSearch NextJS 13 Official Document and about Server/Client Render","ecosystem":"npm","package_name":"reactjs","package_version":null,"solution":"Add\n\n'use client';\n\non top of the file where you are using handleClick because all components in Next 13 by default are server components, therefore for client side interactivity you need to use use client.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/74471642/button-onclick-event-handlers-cannot-be-passed-to-client-component-props","votes":155,"created_at":"2026-04-19T04:41:25.070149+00:00","updated_at":"2026-04-19T04:51:06.838346+00:00"}