coreui-react
coreui-react copied to clipboard
CButton SSR error (CoreUI PRO for Next)
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.
You need to use "use client" directive at the top of the files including these components. Because they contain client side events.