Next.js — React Server-Side Rendering Done Right

Why server-side rendering helps React apps, and when to use or avoid it, with Next.js's original Pages Router. Written in 2017, with a note on the App Router.

Trevor I. Lasn Trevor I. Lasn
Updated 4 min read

This article is outdated

The tools or APIs discussed here have changed significantly since this was written. The article is preserved for reference, but the code examples may no longer work as shown.

Update (2026): This article was written in 2017 and covers the original Next.js Pages Router. Next.js has since introduced the App Router (Next.js 13+), React Server Components, Server Actions, streaming SSR, and many other features that fundamentally changed how Next.js applications are built. For current Next.js guidance, see the official documentation.

Next.js is a minimalistic framework for building React applications that are server-rendered. It was open-sourced on October 25, 2016, by a company called ZEIT, now known as Vercel.

Since then, Next.js has gained a strong reputation and is backed by a stable, active organization in the open-source world. This means that Next.js is here to stay.

Why Should You Care?

You might wonder, “Why should I care about Next.js? I already know how to build React apps.” That’s a valid question. But as developers, we should always be open to new tools and concepts. Learning new things is part of the job, and Next.js can make your life easier as a developer.

Think about it this way: When jQuery came out, it revolutionized web development because it made JavaScript easier to use. If you had ignored it, you would have missed out on significant improvements.

Innovation tends to win in the long run, so why not explore something new?

How Next.js Can Improve Your Life

Next.js offers several advantages right out of the box:

  1. Ease of Use: No need to set up Webpack, React Router, React, and React-DOM separately. It’s all included.
  2. Code Splitting: Automatically splits your code for better performance.
  3. First-Page Load Performance: Improves loading times for the first page your users see.
  4. SEO: Better search engine optimization, which is crucial for many applications.
  5. JavaScript Everything: Next.js builds on the “JavaScript everywhere” philosophy, but with better simplicity and performance than some earlier attempts, like Meteor.

Client-Side vs. Server-Side Rendering

When you use React traditionally, your browser downloads a basic HTML page, and JavaScript fills in the content. This is called client-side rendering.

With server-side rendering (SSR), the initial content is generated on the server. Your browser downloads a fully populated HTML page, making the site load faster and improving SEO.

The Downsides of Server-Side Rendering

Server-side rendering isn’t a silver bullet. It has some downsides:

  1. Server Load: SSR puts more work on your server, which could slow down response times, especially under heavy load.
  2. Increased HTML Size: The size of your HTML files will be larger, which could slow down downloads, especially for apps with large components.
  3. Complexity: Using SSR can make your application more complex, leaving you with less time to focus on other features.

When to Use Server-Side Rendering

SSR is a good choice when:

  1. You Need SEO: Especially for search engines like Google, DuckDuckGo, Bing, Yahoo, or Baidu.
  2. You Need Performance: If you have a working React app and want the best possible performance, and you’re willing to pay for extra server resources.

When to Avoid Server-Side Rendering

SSR might not be the best option when:

  1. Your App Isn’t Finished: If you’re still building your app, focus on getting it working first.
  2. Limited Server Resources: If you have a tight budget or scaling is an issue, SSR might not be the right choice.

Alternatives to Server-Side Rendering

If SSR doesn’t seem like the right fit, you have other options:

  1. Client-Side Rendering: Stick with the traditional approach and rely on Googlebot’s ability to crawl JavaScript for SEO. Your SEO might suffer on other search engines like Baidu, Bing, and Yahoo.
  2. Pre-Rendering Services: Use services like prerender to cache a static version of your pages, improving both SEO and performance without the complexity of SSR.

Conclusion

Next.js makes server-side rendering accessible and straightforward. It’s a powerful tool for improving performance and SEO, all while keeping your development process smooth and efficient. Whether you’re building a new app or improving an existing one, Next.js is worth a look.


Trevor I. Lasn

Trevor I. Lasn

Building whiteheap.com and 0xinsider.com.



Related Articles

Check out these related articles that might be useful for you. They cover similar topics and provide additional insights.

Next.js
14 min read

Next.js 16 makes params async, Turbopack the default bundler and proxy the new middleware, and removes AMP. Every change with code, updated for 16.4.

Oct 25, 2025
Read article
React
7 min read

Run a React app in Docker: write a Dockerfile, start it with Docker Compose, serve the production build with Nginx and deploy it to a VPS.

Jul 16, 2020
Read article
React
5 min read

React Hooks, added in React 16.8, let you write stateful components without classes. Refactor a class component to a function with useState, step by step.

Jun 16, 2019
Read article
Security
3 min read

The vulnerability skips Next.js middleware security checks by adding a single HTTP header

Apr 6, 2025
Read article
React
5 min read

Split a React app's bundle with React.lazy and Suspense, lazy-load routes and CSS, and improve Core Web Vitals, which Google uses as a ranking factor.

Dec 26, 2023
Read article
MCP
3 min read

The Next.js DevTools MCP connects Claude and Cursor to your running dev server. I use it every day.

Nov 2, 2025
Read article
Next.js
12 min read

How I use the 'Three Layers of Data' architecture pattern for React and Next.js apps to avoid common pitfalls, tech debt, and improve performance

May 4, 2025
Read article
React
3 min read

Use Redux with React Hooks: replace connect with useSelector and useDispatch, available since React Redux 7.1, and refactor a component step by step.

Jun 20, 2019
Read article
MCP
6 min read

Build an MCP server in a Next.js route with mcp-handler and createMcpHandler, then connect it to Claude Code, Gemini CLI, Cursor and other MCP clients.

Jan 28, 2026
Read article

This article was originally published on https://www.trevorlasn.com/blog/next-js-react-server-side-rendering-done-right. It was written by a human and polished using grammar tools for clarity.