loading...

ELI5: What is the difference between React and Next.js?

jasonfritsche profile image Jason Fritsche ・1 min read

Hello everyone! I recently started getting in to React (I had a small stint with learning react a couple of years back), and was wondering what exactly is Next.js? Where does it fit in in the React world? What are the use cases?

Discussion

markdown guide
 

Next.js is used when "server-side rendering" (SSR) is needed in React-based frontends. I'll leave it to you to explore what SSR is why we need it. Next.js also comes with some conventions that help you save time worrying about directory structure, routing structure, etc.

 

May be an incomplete example, but if you're familiar with something like Ruby on Rails, think of Next.js as a "framework" to compliment React.

It provides a thin set of conventions for building an application or website, such as routes definitions and compile-time data fetching.

One of the more powerful parts of Next.js is Verecel's hosting solution. With this, the use cases span web/static content hosting all the way to more complex application hosting. As you hit scale, there are usually caveats that come with it, but in my experience can usually be solved with some time and research.

EDIT: Check out their showcase (nextjs.org/showcase) for real-life examples