Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hate to break it to you but Nextjs is for building SPAs.


This 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.


Next.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


I 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.


All of software engineering is a flat circle. All of it. On the backend side it's microservices vs. monoliths.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: