Is nextjs CSR out of the box?
Unanswered
English Angora posted this in #help-forum
English AngoraOP
Hey, I am looking into nextjs to use it in future project. Reading documentation rn and on https://nextjs.org/docs/pages/building-your-application/rendering/client-side-rendering page I dont see any extra code declaring rendering method.
Does it mean nextjs is out of the box and can be used as vite + react alternative for SPA sites, but with nextjs routing system and optimization techniques link Image component? Please do not waste too much time explaining it, short answer would be also super helping for me
Does it mean nextjs is out of the box and can be used as vite + react alternative for SPA sites, but with nextjs routing system and optimization techniques link Image component? Please do not waste too much time explaining it, short answer would be also super helping for me
2 Replies
No, Next.js by default server renders everything. If you want a layout, page or component to be client side rendered you have to include the
See: https://nextjs.org/docs/app/building-your-application/rendering/client-components#using-client-components-in-nextjs
'use client' directive at the top of the file.See: https://nextjs.org/docs/app/building-your-application/rendering/client-components#using-client-components-in-nextjs
That's how it works for the app router