---
title: "Next.js: React with server-side rendering"
description: "Vercel (formerly Zeit) releases Next.js, a React framework with server-side rendering, filesystem-based routing, automatic code splitting and getInitialProps."
url: "https://www.noze.it/en/insights/nextjs-open-source/"
lang: "en"
alternate: "https://www.noze.it/insights/nextjs-open-source/"
published: "2016-11-15"
author: "noze S.r.l."
keywords: "Open Source, Web, Next.js, React, SSR, JavaScript, Framework"
---

# Next.js: React with server-side rendering

Vercel (formerly Zeit) releases Next.js, a React framework with server-side rendering, filesystem-based routing, automatic code splitting and getInitialProps.

15 November 2016

## The client-side rendering problem

**React** applications in 2016 run entirely in the browser: the server sends an empty HTML page, the browser downloads the JavaScript bundle, executes it, and only then does the user see content. This approach — **client-side rendering** (CSR) — has concrete consequences: search engines struggle to index JavaScript-generated content, time-to-first-content is high on slow connections, and configuring webpack, Babel and a server for server-side rendering requires significant effort. **Next.js**, released by **Zeit** (later renamed **Vercel**) under the leadership of **Guillermo Rauch**, proposes an integrated solution.

## Server-side rendering and getInitialProps

Next.js brings **server-side rendering** (SSR) to React without requiring manual configuration. Every page is rendered on the server on the first request: the browser receives complete HTML with content already visible, then React “hydrates” the page to make it interactive. The mechanism is transparent to the developer.

The **getInitialProps** function is the connection point between server and page: it runs on the server during the first request and in the browser during client-side navigation, allowing data to be loaded from APIs or databases before the page is rendered. The developer writes the logic once and the framework decides where to execute it.

## Filesystem routing and code splitting

**Filesystem-based routing** eliminates the need to configure a router: every file in the `pages/` folder automatically becomes a route. A file `pages/about.js` maps to the URL `/about`, a file `pages/blog/[id].js` handles dynamic routes. Convention replaces configuration.

**Automatic code splitting** divides the JavaScript bundle per page: when the user navigates to `/about`, the browser downloads only the code needed for that page, not the entire application. The result is a loading time proportional to the complexity of the individual page, not the whole application.

## Static export

Next.js also supports **static export**: the entire application can be generated as static HTML files during the build, ready to be served from any CDN without a Node.js server. The framework is released under the **MIT** licence and positions itself as the standard for React applications that need SSR, SEO and first-load performance.

**Link**: [nextjs.org](https://nextjs.org)
