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
.
Add
'use client';
asked 2 months ago
1Answers
7Views
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>
);
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
.