What are the potential downsides of using Next.js for serverside rendering vs using plain React

Viewed 460

We're considering rewriting our react app to use serverside rendering and got introduced to Next.js. It seems like a great solution that should work well right out of the box (routing, webpack, etc) with minimal setup. However we're not sure what the potential pitfalls might be going down this route and when it might make more sense to just build out out the project around the renderToString method provided by react. Any insight from someone who's worked with both solutions would be greatly appreciated.

1 Answers

Next.js is an opinionated web framework, while plain React is merely a library for manipulating the DOM. By using Next.js, you’ll find that it has a file-based router built-in, along with SSR and other things you otherwise would have had to implement yourself. This only becomes a downside if you needed to implement a different router or something like Redux — you may find yourself fighting Next.js in this case. However, if you're happy with the functionality of Next.js, especially the SSR rendering features, then it can save you a lot of time and stress.

Related