Cons of next.js over create react app + redux + ssr

Viewed 10458

I have developed an application using React + redux + EJS (with server side rendering) and its running fine in production. I have configured SSR + redux and all the code splitting stuff using webpack config. I have also implemented custom cache middleware to cache the SSR rendered html string ( as needed).

Now, I have been told to refactor the code to suit next.js framework and was wondering the real need for that. What are the main advantages of using next.js if I have already figured out a way to do SSR without next.js framework?

I am not just asking an opinion rather I am trying to understand the real pros/cons of next.js (if any) over CRA.

I have uploaded the boiler plate here if anyone needed a reference: https://github.com/bbest123/reactreduxssr

2 Answers

tl;dr

The only con (kind of) I can think of using Next.js is that it's opinionated. It would require you to structure things in a certain way which IMO is still quite extensible.

Advantages of using Next

All these things said, if you've already built your solution without Next.js and it works fine for your usecase, IMO there isn't a need to migrate to Next unless you are interested in abstracting some of the configurations and workings of SSR (which Next.js would take care of).

Relevant links

One of Nextjs' best features is huge list of 70+ list of implementation examples representing almost every combination of CSS framework, store (flux/redux/mobx/graphQL) framework, node servers, etc.

It is possible to build a react SSR solution without Next.js, but the clean hooks for server-side logic (getInitialProps, pages/app.js, etc ...) are what makes Next.js a top choice here. Next.js shines here by allowing you to write clean, maintainable, and Performant SSR web applications.

Lastly, the development team & community is amazing!

Related