3 ms·
I'd argue most Next sites use only client side rendering.
by louissm_it 5y ago
I'd argue most Next sites use only client side rendering.
- koonsolo 5y agoSo using the export function? Or do they still run the next.js server without having the real benefit of it? In other words: what is the benefit of next.js when you only do CSR?
- crooked-v 5y agoIt's easier, faster, and has more default features than setting up Webpack by yourself.
- louissm_it 5y agoGreat question! If you're interested, I'd recommend reading up a bit on all the different rendering and deployment modes Next offers with and without Vercel/Netlify. If you use Next.js only for CSR, as I'm sure most people do, the benefits are great defaults, easy upgrades, fantastic routing, page prefetching, and easy upgrading to any of the other rendering modes if you ever need them. You don't run any kind of server if you just use CSR - you bundle your code and push it to anywhere you'd push your normal React SPA (CDN, Vercel, Netlify, etc). I you decide you need to server side render or pre render a page, you can of course run a full node server - but the far easier route is to use the Vercel/Netlify lambda functions(which work out of the box with Next). I find thinking of Next pages as separate little apps composing the same layout component to be far more maintainable than the more traditional SPA single layout swapping the contents to simulate a page transition.