NEXT.js What is NextJS

What is NextJS? And why would you use it?

NextJS is a React Framework it builds on top of React.

Why do we need another framework, isn’t React itself already a library?

It vastly simplifies the process of building fullstack applications with React.

Trend in last couple years build fullstack apps instead of SPAs (Single Page Applications).

With NextJS you get the best of both worlds: Highly interactive frontends, blending seamlessly with tightly connected backends.

React is becoming a hybrid library. React is adding more features to run react on the server and render components on the server.

Using these features without a framework is tricky & typically not all you need: Route Setup & Handling, Form Submission, Data Fetching, Authentication and much more.

NextJS handles route setup & config, handles requests and responses, handles data fetch & submission and more.

You need a solid React foundation to build NextJS applications.

NextJS allows you to take your React apps to the next level and to build fullstack applications with React.

Key Features & Benefits

Fullstack Apps

NextJS blends frontend + backend (in the same project). Advantage: Frontend and backend tasks are part of the same project.

NextJS enhances React by creating fullstack applications, one benefit of this is more secure data requests.

File-based Routing

NextJS has Filesystem-based Routing. NextJS uses files & folders to define routes. Only files & folders inside the “app” folder are considered apart of the Routing.

In a vanilla JavaScript app you would define your routes with code.

With NextJS you configure Routes via the filesystem (folders + files). Advantage is no extra code base conig or extra packages for routing are required.

Server-side Rendering

NextJS renders all visible content all pages and components on the server. The content that is sent to the client is already rendered on the server.

The advantage is that HTML page content is rendered, this is great for SEO.