DEV Community

Cover image for If no SSR/SSG planned, is it wrong to go with Next.js ?

If no SSR/SSG planned, is it wrong to go with Next.js ?

Peret Etienne on June 05, 2021

Hi, Soon, I have to think about a total rework of a project, currently in Symfony, to a React app. I already have work on two back-office/dashboar...
Collapse
 
wh1zk1d profile image
Jannik Baranczyk

Even if you don't plan to use SSR/SSG, Next.js is a great choice imo, since it removes many pain points from CRA (routing, head stuff etc.). I just finished a big project (operative dashboard) that also didn't make any use of SSR, instead all the data was fetched on client side – it never felt like "Next isn't made for this".

Collapse
 
hbgl profile image
hbgl

You may never need to do SSR. The only real benefit is faster time to paint for the initial page view. Unless that is really important for your application, then I would stay away from it because of all the added complexity. The other often cited benefit of SSR is better SEO and supporting page previews on third party websites (e.g. linking a page on Twitter). But, you can also achieve this by prerendering your pages in a headless browser only for those bot user agents (check out rendertron or prerender.io).

Collapse
 
dastasoft profile image
dastasoft

Nextjs has some clear advantages like SSR and SSG (even Incremental Static Regeneration) but you can use it with other ambitions. Things like not having to deal with react-router-dom (or any other routing library) or the Image Optimization plugin can be useful too, it's also easy to set up better SEO.

My rule of thumb is that if you know React well enough and know what problems Nextjs solves over a CRA project, go on, there's a video from Next Conf called When not to use Next.js that might fit your questions.

Collapse
 
rafde profile image
Rafael De Leon

you can always use export if you only plan to have static pages.
Also, next js is always looking for ways to make app builds fast via swc or other means. They also update their libraries a lot and update frequently to improve dev experience. It has good foundation to build on. Can't go wrong with nextjs... unless you don't use react with it for some reason. Preact support is spotty since they do more to get react working with it.

Collapse
 
natalia_asteria profile image
Natalia Asteria

Use Next.js imo. Next.js isn't just for SSR and SSG.