I've used both NextJs and CRA. Both these frameworks can be used to get started quickly and provide a good developer experience. However, both of these have use cases where either of them shines better. I'll try to compare them based on some of these factors. Feel free to suggest edits with additional points or comments
Server Side Rendering
| CRA | Next.js |
|---|---|
| CRA doesn't support SSR out of the box. However, you can still configure it. It just takes more effort to setup SSR with your preferred server and configuration. The development team doesn't have plans to support this in the near future. They suggest other tools for this use case. |
NextJs has different types for SSR. It supports SSR out of the box. * Static generation: fetch data at build time. This works best for use cases like blogs or static websites * Server side rendering: fetch data and render for each requests. You have to do this when you need to serve different view for different users. |
Configurability
I think this is point where these tools are very different and your decision can depend on this factor
| CRA | Next.js |
|---|---|
| Create React App doesn't leave you a lot of room to configure it. Configurations like webpack config cannot be changed unless you stray away from normal CRA way (eject, rescripts, rewired, craco). Basically, you have to use what's configured in react-scripts which is the core of CRA. |
Almost everything is configurable. If you check the example NextJs templates, you can see files like babelrc, jest.config, eslintrc etc that you can configure. |
Maintainability
| CRA | Next.js |
|---|---|
| CRA is very opinionated. If you keep updated with the releases of CRA, it's not hard to maintain. |
NextJs is also well maintained. They release regular updates. |
Typescript
| CRA | Next.js |
|---|---|
Supports out of the box. You can initialize CRA app with typescript with npx create-react-app my-app --template typescript |
Supports typescript out of the box. Start with configurations for typescript with touch tsconfig.json |
Hooks support
Latest version of both CRA and NextJs installs a version of React that supports hooks. You can also upgrade to the latest version easily
Redux support
Redux is a library that you can use with both these tools.
Answer from sudo bangbang on Stack OverflowSelf taught developer here. Should I skip building projects with react js and go straight to Next Js for my portfolio?
I really want to build vanilla javascript projects then convert them into react js and then into next js to demonstrate proficiency. Wondering if that may be overkill though.
I'm focused on building full stack projects btw.
reactjs - What is the difference between Next.js and Create React App? - Stack Overflow
SWR vs React Query for Next.js
My feeling is that React Query is the better solution right now, SWR is still playing catch up.
However, if you're satisfied with SWR and don't need a certain feature that only React Query has, I don't think it's worth switching.
More on reddit.comRemix vs Next.js
Quality of the package aside, I'm so sick of the shameless self-aggrandizing nonstop promotion from Kent. This is not the way to behave as a figure of authority in the open-source JS world. Kent has become a business and built a brand for himself as a teacher, but over the years he's become shady as fuck. Somebody posted on this or the JS reddit the other day about his deceptive business practices, I want to go and dig it up now.
I'm sticking with Vercel, a company that truly cares about this community.
More on reddit.comWhat’s best IDE for React/Next.js?
When should I use Next.js instead of React?
Is Next.js faster than React?
What companies use Next.js and React?
Videos
I've used both NextJs and CRA. Both these frameworks can be used to get started quickly and provide a good developer experience. However, both of these have use cases where either of them shines better. I'll try to compare them based on some of these factors. Feel free to suggest edits with additional points or comments
Server Side Rendering
| CRA | Next.js |
|---|---|
| CRA doesn't support SSR out of the box. However, you can still configure it. It just takes more effort to setup SSR with your preferred server and configuration. The development team doesn't have plans to support this in the near future. They suggest other tools for this use case. |
NextJs has different types for SSR. It supports SSR out of the box. * Static generation: fetch data at build time. This works best for use cases like blogs or static websites * Server side rendering: fetch data and render for each requests. You have to do this when you need to serve different view for different users. |
Configurability
I think this is point where these tools are very different and your decision can depend on this factor
| CRA | Next.js |
|---|---|
| Create React App doesn't leave you a lot of room to configure it. Configurations like webpack config cannot be changed unless you stray away from normal CRA way (eject, rescripts, rewired, craco). Basically, you have to use what's configured in react-scripts which is the core of CRA. |
Almost everything is configurable. If you check the example NextJs templates, you can see files like babelrc, jest.config, eslintrc etc that you can configure. |
Maintainability
| CRA | Next.js |
|---|---|
| CRA is very opinionated. If you keep updated with the releases of CRA, it's not hard to maintain. |
NextJs is also well maintained. They release regular updates. |
Typescript
| CRA | Next.js |
|---|---|
Supports out of the box. You can initialize CRA app with typescript with npx create-react-app my-app --template typescript |
Supports typescript out of the box. Start with configurations for typescript with touch tsconfig.json |
Hooks support
Latest version of both CRA and NextJs installs a version of React that supports hooks. You can also upgrade to the latest version easily
Redux support
Redux is a library that you can use with both these tools.
Create React App is just a React project creation engine to help you setup your React project quickly. After running the CRA script npx create-react-app <appname> you will get a nice and clean single-page application that you can run. Under the hood you also get things like babel, eslint, jest, webpack already setup so it's a really convenient way to start doing React development. And in case you'd need more control over the configuration of those tools, you can still use npm run eject.
Next.js on the other hand is a framework based on React to build Node.js server-side apps. This means you will use the same component-oriented logic to build pages and leverage the Next.js routing engine for page to page navigation. Server-side rendering will allow loading time to be more spread over time, so perceived performance will be probably better. Redux can be used as well but there will be some additional steps to make it work properly (see https://github.com/kirill-konshin/next-redux-wrapper)
Whatever you choose, in the end, it will be React coding. Components, JSX, TypeScript support, React hooks, and all other core aspects of React will be supported either way. Therefore, you can expect similar degree of maintainability. On the other hand, scalability depends on your choice: if you choose Next.js you will host the app on a server infrastructure which should be sized according to your audience whereas React bundle created with CRA just need to be statically hosted somewhere.