coreui-react icon indicating copy to clipboard operation
coreui-react copied to clipboard

CButton SSR error (CoreUI PRO for Next)

Open kemalatila opened this issue 1 year ago • 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: <CButton color="primary" className="py-2 px-4 ms-2"> Save </CButton>

"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.

kemalatila avatar Sep 13 '24 17:09 kemalatila

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

majsterkoo avatar Sep 14 '24 09:09 majsterkoo