How to convert shadcn/ui components to Client component?
I'm using shadcn/ui components, and I can't make them interactive. E.g.
<Button onClick={() => console.log("hi")}></Button>
gives error16 Replies
It already is a client component
It’s talking about your component
Don’t tell me I have to repeat what I said 😂
Yeah, sorry, you will have to elaborate more could i fix it? 😄
Your. Component. Is. Server. Component.
Server component cannot pass event handlers to client components
Could I convert it to client component?
It’s your component
so what?
can I convert it to client side?
Why don’t you try making it into a client component
how could I do that?
Google how
Docs
Just set the parent component to "use client"
in the start of file add a line
'use client'
Apologies if my advice seems unsolicited, but saying directly how to do it, @thatbarryguy , could have possibly avoided repeated questions from that guy. It's clear the person is an absolute beginner. Thanks for understanding.
I’m not gonna spoon feed
He should be able to Google simple things
the uncle no one ever wants around