CodeWithPrashant
Frontend

React and Next.js: Choose a Rendering Strategy for Your Project

prashant palAug 16, 2026 4 min read 54 views

React and Next.js: Choose a Rendering Strategy for Your Project

React is a UI library. Next.js is a framework built around React. The useful decision is not whether one is “production ready” and the other is not: both can power production applications. Decide which routes need public content in their initial HTML, which interactions need browser state, and which operations must stay on a server.

Consider a developer-learning website with three screens: a public article, a searchable course catalogue, and a private learner dashboard. These screens do not necessarily need the same rendering strategy.

Start with the public article

A reader opening a shared article should receive its heading, author, body and relevant links without first waiting for a second browser request. In the Next.js App Router, a page is a Server Component by default. It can fetch an article and return its content while a smaller Client Component handles an interactive bookmark button.

Here is a minimal example using a local data module. It demonstrates the boundary without depending on an invented API service:

// app/articles/page.tsx — Server Component
import Link from 'next/link'
import { articles } from './data'

export default function ArticlesPage() {
  return (
    <main>
      <h1>Engineering articles</h1>
      <ul>
        {articles.map(article => (
          <li key={article.slug}>
            <Link href={`/articles/${article.slug}`}>
              {article.title}
            </Link>
          </li>
        ))}
      </ul>
    </main>
  )
}
// app/articles/data.ts
export const articles = [
  { slug: 'request-races', title: 'Understanding request races' },
  { slug: 'cache-freshness', title: 'Choosing cache freshness' }
]

Create a matching app/articles/[slug]/page.tsx before treating these links as a complete application. In an API-backed version, explicitly handle missing articles, timeouts and upstream errors. Do not show an empty publication when the real problem is a failed request.

The Next.js Server and Client Components guide explains this division. Server rendering helps deliver content, but it does not guarantee indexing, rankings or advertising approval.

Add interactivity where it is needed

A category selector needs browser state. That does not mean the entire page must wait for client-side fetching. A server page can pass public article summaries into a small client component:

// app/articles/category-filter.tsx
'use client'

import { useState } from 'react'

type Item = { slug: string; title: string; category: string }

export function CategoryFilter({ items }: { items: Item[] }) {
  const [category, setCategory] = useState('All')
  const categories = ['All', ...new Set(items.map(item => item.category))]
  const visible = items.filter(item =>
    category === 'All' || item.category === category
  )

  return (
    <section>
      <label>
        Category
        <select value={category} onChange={e => setCategory(e.target.value)}>
          {categories.map(value => <option key={value}>{value}</option>)}
        </select>
      </label>
      <ul>{visible.map(item => <li key={item.slug}>{item.title}</li>)}</ul>
    </section>
  )
}

This example filters already supplied summaries. For thousands of records, server-side filtering and pagination may be more appropriate. Passing every full article to the browser wastes bandwidth; send only the fields that the listing needs.

Treat the dashboard separately

A private dashboard often benefits from client-side queries, optimistic updates and frequent refreshes. It still needs server-enforced authorization. A hidden button, a route redirect or a Client Component is not an access-control boundary.

Keep payment credentials, database access and privileged checks on the server. Even a Server Component must verify what the current user can read. Avoid caching personalized responses as if they were shared public content.

A React application built with another framework or a carefully configured client build can also meet these requirements. React itself does not mandate that every route use client-side rendering. The React project setup guide recommends frameworks for new applications and explains alternatives when their constraints do not fit.

Compare deployment constraints before choosing

QuestionWhy it changes the decision
Does the site contain public articles or product pages?Plan how complete content reaches the initial response.
Is it an embedded interactive widget?A standalone React client build may fit without a full application framework.
Do routes require request-time authentication or fresh server data?You need a compatible server runtime or separate backend.
Is only static hosting available?Check static-export constraints before using server-only features.
Does the team already operate a backend?Reuse it where useful; adding a framework does not require replacing it.

Next.js can produce static output for compatible routes, but a static export cannot execute request-time server logic. Conversely, a framework route does not need dynamic rendering merely because the framework supports it. Match deployment to the features you actually use.

Verify the result instead of relying on labels

For the public article, inspect the initial HTML with JavaScript disabled: can you read the heading and body and follow real article links? Test an unknown slug and an unavailable backend. For the dashboard, use two accounts and confirm one cannot request the other's private records. For filters, change categories with the keyboard and check the empty state on a narrow screen.

Measure your own page before saying that one implementation is faster. A large JavaScript bundle, slow backend query or oversized image can dominate performance regardless of the framework name.

To practise the distinction, build one public article route and one private dashboard route. Write down what runs on the server, what runs in the browser, and why. Then explore React request-race handling and a booking-system design exercise for the next set of implementation decisions.

Comments

Log in to join the discussion.

Loading comments...