npmreactjs95% confidence\u2191 155

<button onClick={}> Event handlers cannot be passed to Client Component props

Full error message
Error: Event handlers cannot be passed to Client Component props.

^^^^^^^^^^
If you need interactivity, consider converting part of this to a Client Component.

const reqHelp = () => {
    Swal.fire({
        title: '1',
        text: '1',
        icon: 'warning',
        showCancelButton: true,
        confirmButtonColor: '#3085d6',
        cancelButtonColor: '#d33',
        confirmButtonText: 'Yes',
        cancelButtonText: 'No',
    })
}

return(
        <div className="buttons">
            <button onClick={reqHelp} className="stopwatchButton">Request Help</button>
        </div>
);

Search NextJS 13 Official Document and about Server/Client Render

Add 'use client'; on 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.

API access

Get this solution programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/error/255f4cfdc02a5490eb8f4e0e503856cd3e270ae4dbcc2dfab2f5912c24e38d14
hash \u00b7 255f4cfdc02a5490eb8f4e0e503856cd3e270ae4dbcc2dfab2f5912c24e38d14
&lt;button onClick={}&gt; Event handlers cannot be passed to… — DepScope fix | DepScope