Why I choose NextJS over CRA for new projects

Andrew Lee - Nov 28 '21 - - Dev Community

I used to use Create React App (CRA) for building new applications (i.e. app.example.com). For landing pages, however, I would use NextJS for better SEO (i.e. www.example.com). Nowadays I will exclusively use NextJS over CRA when starting new applications for the following three reasons.

Reason 1: Monolith

When starting a new application, the main goal is to find product market fit. This means reducing distractions. With Create React App, we might need to build three different applications to test out our idea (Client App, Landing Page, API). With NextJS, we only need to build one app to test out our idea.

NextJS allows us to build our landing page, application, and API server all in a monolith. We can write backend routes that interact with a database inside of the api/ directory, server side render pages that is important to SEO, and also render things in the client side if necessary.

I want to build a monolith when kickstarting an app without compromising SEO. NextJS is the only tool that allows me to do that so that I can focus on solving problems for customers.

Reason 2: Performance

Google ranks websites with better performance higher in search results. Therefore some say only use NextJS when SEO matters...but it's hard for me to think of a reason why we would not want better performance and SEO regardless of the application. Why sacrifice on SEO when we don't have to? NextJS gives us the best of both worlds; we can decide when to server side render and when to client side render.

Reason 3: Ecosystem

By using NextJS, we expose ourselves to not only the React ecosystem but also the Vercel ecosystem. Vercel provides us with an easy way to deploy our NextJS application and take advantage of serverless. I am very excited to see Vercel build upon their edge functions to provide an end to end development platform for JavaScript engineers.

Conclusion

I reach for NextJS when starting any new application because it allows me to build a monolith using a mature framework to validate business ideas without sacrificing on performance.

. . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player