5 ms·
Hate to break it to you but Nextjs is for building SPAs.
by tofuahdude 5y ago
Hate to break it to you but Nextjs is for building SPAs.
- midiguy 5y agoI was going to say.... ironically NextJS is just an additional layer for creating static-rendered sites over an SPA framework. We have come full circle.
- deltaonefour 5y agoAll of software engineering is a flat circle. All of it. On the backend side it's microservices vs. monoliths.
- Toine 5y agoThis is way oversimplified. You can build a completely static website with NextJS. What I love about it is that you can do everything : SSR by default, SSG as an option, and awesome features like ISR etc. However, the way NextJS implements SSR is really weird right now : if you use their <Link/> component, the pages props are actually fetched with an XHR request, then the page is rendered. I don't know why. It does feel like an SPA in the end.
- sinker 5y agoNext.js recommends delivering static assets by default and is geared towards that. > We recommend using Static Generation (with and without data) whenever possible because your page can be built once and served by CDN, which makes it much faster than having a server render the page on every request. If you need dynamic content, they recommend server-side rendering, and lastly client-side rendering only if the page is unaffected by SEO and requires a lot of in-page updates. https://nextjs.org/learn/basics/data-fetching/two-forms https://nextjs.org/learn/basics/data-fetching/two-forms