Next.js Discord

Discord Forum

Why does not next.js render page both on server and client same time?

Answered
American Shorthair posted this in #help-forum
Open in Discord
American ShorthairOP
I have been using next.js and sveltekit for some time. Why can not I use events on serverside page in next.js? and why can not I render a page on server which can use events? while in sveltekit you can both render page on server and also use the events, such as on click and etc.
That means I am either sacrifising SEO or interactive UI
Answered by Giant panda
You aren't sacrificing anything. Anything interactive has to be a client component, but client components are still prerendered ensuring SEO.
View full answer

2 Replies

Giant panda
You aren't sacrificing anything. Anything interactive has to be a client component, but client components are still prerendered ensuring SEO.
Answer
American ShorthairOP
Okay thanks a lot