Next.js Discord

Discord Forum

Event handlers in server components

Unanswered
Cape lion posted this in #help-forum
Open in Discord
Cape lionOP
I am fairly new. I understand we can't have event handlers in server components. But then how to achieve interactivity? How can I listen for a click?

7 Replies

only client components are interactive with the "use client" at the top
you can render client components in server components tho
Cape lionOP
oh so I have to break down the component even more?
yes
depends
You can import and use a client component in a page (server component)
Cape lionOP
ok will try