Create React App vs Next.js
Tags: react, nextjs, javascript
Published: 2020-10-12 13:23:50


As a developer, there are many choices to make when building your next application. The rise of serverless technologies allows developers to build and run applications without thinking about servers and this also allows front-end developers to create full-stack applications and build SAAS web apps.

In **Stack Choices**, we take a closer look at some technologies that can help us to build these types of applications and try to make a good decision on what to use. In the last episodes, I took a look at [JavaScript vs TypeScript](https://medium.com/stack-choices-javascript-vs-typescript-c9db39b67bf6) and [React vs Vue vs Angular vs Svelte](https://medium.com/stack-choices-react-vs-vue-vs-angular-vs-svelte-49aa0170c634). This time, let’s take a look at [**Create React App**](https://reactjs.org/docs/create-a-new-react-app.html) **(CRA) vs** [**Next.js**](https://nextjs.org/).

[CRA](https://reactjs.org/docs/create-a-new-react-app.html) is a tool that gives you a massive head start when building React apps. It saves you from time-consuming setup and configuration. You simply run one command and Create React App sets up the tools you need to start your React project. This is great to start focusing on building your application from the start and don’t waste time configuring your webpack etc. But for building performing production-ready applications, you might need a little bit more. You might need serverside-rendering for SEO, or code-splitting to increase performance. You could use a boilerplate that has some features built-in (like [React Milkshake](https://www.reactmilkshake.com/)), or you can take a look at a framework like [Next.js](https://nextjs.org/).

## Next.js

Next.js is a framework built by [Vercel](https://vercel.com/dashboard). It’s open-source, based on Node.js and Babel, and it integrates with React to develop single-page applications. It makes Serversside rendering very easy. According to [nextjs.org](https://nextjs.org/):

> _With Next.js, server rendering React applications has never been easier, no matter where your data is coming from._

Next.js also supports static exporting, pre-Rendering, and has a lot more nice features like automatic building size optimization, faster dev compilation, and preview mode.

In my opinion, the current version of Nextjs is what React was missing for a long time. It has all the features you need when you build a production-ready application that needs to perform. Also, the docs are nice and it’s becoming more and more popular among front-end developers.

Next.js is really good, but that doesn’t mean you should always go with this framework.

Although it makes server-side rendering a lot easier, it still introduces some complexity. For instance, if you use Redux, your store should also be in sync on the server. And when you use translated labels inside your application, be aware that this must also be handled on the server.

Also, for every server-rendered route that you have, a serverless function will be created. Currently, the free tier a limitation of 12 serverless functions, so if you use SSR and your app has more than 12 routes you need to pay for hosting. This might not be a problem for everybody, but when you build your app with CRA you are sure you can host it on platforms like [Vercel](https://vercel.com/dashboard), [Netlify](https://netlify.com/), or [Render](https://render.com/) for free. I wrote an article that dives a little deeper into this, you can read it here: [Why I Migrated From Next.js to Create React App](https://medium.com/better-programming/why-i-migrated-from-next-js-to-create-react-app-7e74834e8431)

## Conclusion

CRA is a great starting point for your next app, but to take things to the next level I think Nextjs can come in handy. It does introduce a little more complexity in certain areas and I’m not really happy with serverless functions limitations, but I think Next.js offers so many nice features that my decision is clear: **Next.js**.

If you think differently, please try to change my mind! Any other opinions? Leave them in the comments.

---

If you’re interested in saving time on your next project and skip implementing authentication, payments, etc. then [subscribe here](https://serverless.page/) to follow my progress in building the SaaS starter-kit for React developers. You can also [follow me on Twitter](https://twitter.com/jakeprins_nl), or at [www.jakeprins.com](https://www.jakeprins.com/).