coreui/coreui-react

CButton SSR error (CoreUI PRO for Next)

Closed this issue · 1 comments

I use CoreUI PRO for Next with ready template but I get errors when I try to use SSR. I've noticed so far CFormInput and CButton give errors.

For Instance:

Save

"Error: Event handlers cannot be passed to Client Component props.
<button className=... onClick={function onClick} disabled=... type=... children=...>
^^^^^^^^^^^^^^^^^^
If you need interactivity, consider converting part of this to a Client Component." error message is that.

You need to use "use client" directive at the top of the files including these components.
Because they contain client side events.