Next Vs React

Posted on  by admin

Editor’s note: This article was updated on 3 February 2022 to incorporate information about the developer experience in React 18.

When choosing any software library or framework, one normally considers the developer experience. When I say “developer experience” here, I mean to say what it’s like for developers to actually do the task. Developers generally favor libraries or frameworks that are fun and easy to use.

This is a major reason why we have the leading libraries and frameworks today. In the world of React, Next.js has become a popular framework for “hitting the ground running.” As a React fan myself, I picked up Next.js a few months ago and have really enjoyed working with it on my projects.

I liked it so much, that I even rewrote my personal blog using Next.js (check out my post on it).

  • Next.js builds on top of React to provide a streamlined development experience.
  • There is a small learning curve with Next.js, but even developers new to the world of frontend can get up and running relatively quickly. That being said, there is definitely a different experience when building a project with Next.js vs.
  • This post compares the developer experience of Next.js vs. I’ll walk through some background first and then dive into more specifics, discussing what it’s like to initially start a project, build pages, retrieve data, use the documentation, and perform advanced actions with both Next.js and React.
  • I’ll be referring to a sample project that you can find in my GitHub repo here.
  • This project shows two different implementations of a fan site about the hit show The Mandalorian.
  • The react folder in the project is the React version, of course, and the next.js folder contains the Next.js version.

Both projects work and should only need the standard npm install to get up and going.

  • You can use the following to jump to a relevant section of the tutorial:.
  • Before we dive into the actual developer experience, it helps to have some background. React was originally created by Facebook and has become one of the most popular libraries in the frontend world today.
  • React is easily extendable and can include features like routing as well as state management patterns with libraries like Redux.