Urgent.News

What's breaking now, across hundreds of outlets.

Tech

React Server Components Guide: Architecture, Examples, and Best Practices

React Server Components (RSC) introduce a different way to think about rendering React applications. Instead of sending every component's JavaScript to the browser, developers can render selected components on the server and send their results to the client, reducing the amount of JavaScript users need to download and execute. RSC are especially useful for applications that display database…

React Server Components offer a novel approach to building React applications, with their server-side rendering capabilities reducing the amount of JavaScript needed for client-side execution. This article explores React Server Components, contrasting them with traditional client components, and provides a practical example of implementing server components for a product catalog application.

React Server Components are components that execute on the server and can access server-side resources without exposing them to the browser. The framework then uses the rendered output of these components—a React Server Component payload—to update the UI. Unlike server-side rendering, where components merely render HTML on the server before hydration in the browser, React Server Components can remain server-only, meaning their implementation does not need to be included in the client-side JavaScript bundle.

Server Components are ideal for tasks such as data fetching, database access, reading files, and rendering content that doesn't require browser APIs. Meanwhile, Client Components are necessary for features like event handlers, local interactive state, effects, and browser-specific APIs. By default, components are Server Components unless they're marked within a client boundary using the `use client` directive, which marks that module and its dependencies as part of the client-side component graph.

The guide demonstrates a practical example using a product catalog application. Here, a Server Component retrieves product data directly from a server-side data source, eliminating the need for the browser to make a separate request for the initial data. The architecture separates server-side product retrieval from client-side interaction, with console logs illustrating the responsibilities of each layer.

This example, while educational and simplified, represents the conceptual architecture of React Server Components rather than a direct implementation of the runtime or transport protocol.

In a framework like Next.js App Router, a catalog page can be an asynchronous Server Component that retrieves products directly from a database or backend service. A separate client component, marked with `use client`, can handle user interactions such as filtering products or adding them to a cart. It's crucial to keep sensitive information like database credentials and privileged API keys out of client modules.

Additionally, props crossing between Server and Client Components must be serializable according to React's supported serialization rules, meaning only ordinary functions and standard serializable data structures can be passed as client props.

While React Server Components can significantly reduce client JavaScript and simplify secure data access, they don't automatically enhance every application's performance. Factors such as slow database queries, excessive sequential requests, large rendered payloads, and inadequate caching strategies can still impact performance negatively.

Therefore, it's essential to fetch independent data concurrently, employ appropriate caching and revalidation policies, and maintain focused client boundaries for interactions that genuinely require them. Performance should always be measured in real-world production scenarios rather than assuming that moving work to the server always results in better performance.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

policies.json: this is how Firefox is configured in the company

Un administrador de TI puede bloquear extensiones, apagar el guardado de contraseñas y forzar actualizaciones en miles de equipos sin tocar una sola máquina: las políticas de Firefox Enterprise hacen…

  • Firefox Enterprise policies configure browser settings for thousands of machines.
  • policies.json file reads by Firefox on startup to enforce settings.
  • policies.json provides audit trail for regulatory compliance and security controls.

Health Check Log Cost Attribution: Isolating Malformed JSON Ingest 400 Bad Requests

Short answer: treat a 400 Bad Request from health-check log ingest as a boundary failure, then preserve the rejected payload, validate JSON syntax separately from schema, and attach cost dimensions…

  • Node.js health check logs reject malformed JSON with 400 Bad Request
  • Three tests isolate rejection layer: parser, shape/types, policy constraints
  • Redacted sample per payload fingerprint aggregates counts efficiently

Hybrid Azure AD Join Pending: A Read-First Triage Order for Entra Connect Admins

The ticket says the laptop is domain-joined and Intune-ready, but in Microsoft Entra admin center > Devices the record sits on Pending for days. Outlook starts prompting.

  • Check device registration status with dsregcmd /status command
  • Verify device syncs with Entra ID via AD and Entra ID objects
  • Confirm Service Connection Point points to correct tenant

More from Wednesday, 14 October 2026 →