React Server Components: The Next Evolution in Web Development

React Server Components (RSC) represent one of the most significant advancements in the React ecosystem since its initial release. Introduced with React 18, RSC provides an innovative solution for optimizing performance and improving developer experience in modern web applications.

And Now You Understand React Server Components
React Summit 2024React Summit 2024
27 min
And Now You Understand React Server Components
Top Content
In this Talk, Kent C. Dodds introduces React Server Components (RSCs) and demonstrates how to build them from scratch. He explains the process of integrating RSCs with the UI, switching to RSC and streaming for improved performance, and the benefits of using RSCs with async components. Dodds also discusses enhancements with streaming and server context, client support and loaders, server component rendering and module resolution, handling UI updates and rendering, handling back buttons and caching, and concludes with further resources for diving deeper into the topic.

"And Now You Understand React Server Components" - Kent C. Dodds demonstrated in his talk at React Summit 2024, that understanding RSC becomes clearer when building them from scratch, providing developers with a solid mental model of how they function at a fundamental level. Dodds shows how to build React Server Components and a framework based on them, explaining the process of integrating RSCs with the UI, switching to streaming for improved performance, and leveraging the benefits of async components. This epic talk about React Server Components is marked by GitNation visitors as a "Top Content" and it should be in your watch list for sure!

"My name is Kent C. Dodds and I'm excited to give you this talk and now you understand React Server Components. Wish me luck!"

Understanding React Server Components

React Server Components are a feature that allows components to be rendered on the server rather than in the client's browser. This significant paradigm shift facilitates faster initial load times, reduces the complexity of state management, and enhances user experience by enabling data fetching directly within components.

In his presentation "Simplifying Server Components" at React Advanced 2023, Mark Dalgleish broke down the different moving parts of RSC to help developers understand what's happening under the hood, exploring the boundary between React and the frameworks built upon it. Dalgleish explains how server components offer a mental model of components as pure functions and emphasizes that RSC responses are serialized virtual DOM that offload code from the client while maintaining interactivity.

RSC balances server and client capabilities, offering key advantages including:

  • Enhanced performance through server-side rendering
  • Improved security by keeping sensitive operations server-side
  • Streamlined development processes
  • Zero-bundle size for server components

Aashima Ahuja provided a comprehensive overview of these benefits in her talk "Zero Bundle Size Server Components" at React Advanced 2022, explaining how RSC not only reduces bundle size but also improves page load times for better user experience. Ahuja demonstrated how offloading work to the server can significantly improve performance and minimize JavaScript payload sent to the client.

History and Evolution of React Server Components

React Server Components emerged as a natural evolution in the React ecosystem, addressing limitations in both pure client-side rendering and traditional server-side rendering approaches. Prior to RSC, React development primarily focused on Client Components rendered in the browser, with server-side rendering (SSR) as a separate optimization technique.

Server Components: The Epic Tale of Rendering UX
React Summit 2023React Summit 2023
26 min
Server Components: The Epic Tale of Rendering UX
Top Content
Watch video: Server Components: The Epic Tale of Rendering UX
This Talk introduces server components in React, which provide an intermediate format for rendering and offer advantages for both client-side and server-side rendering. Server components reduce bundle size on the client and improve search engine optimization. They abstract the rendering process, allowing for faster rendering and flexibility in choosing where to render components. While server components are still in the experimental stage, Next.js is a good starting point to try them out.

Nikhil Sharma illustrated this evolution vividly in his talk "Server Components: The Epic Tale of Rendering UX" at React Summit 2023, using narrative storytelling to explain how server components provide an intermediate format for rendering and offer advantages for both client-side and server-side rendering. Sharma's presentation highlighted how React's rendering strategy has evolved from pure client-side rendering to the hybrid approach enabled by server components.

The advent of RSC with React 18 and Next.js 13 represented a paradigm shift, offering developers a new way to handle component rendering while maintaining React's component model. This evolution has allowed React applications to become more efficient and performant while preserving the developer experience that made React popular in the first place.

Architecture

Overview of Component Types

The introduction of Server Components has added complexity to React's architecture by distinguishing between two primary types of components:

  1. Server Components: Execute entirely on the server with direct access to backend resources
  2. Client Components: Run in the browser and handle interactivity and client-side state

As Maurice de Beijer explained in his workshop "Mastering React Server Components and Server Actions in React 19" at React Summit US 2024, developers must now consider how to structure their applications with these two types, leading to additional decisions related to user experience, interface design, and state management. De Beijer's workshop emphasized that server components render on the server, eliminating REST call overhead and simplifying data access while providing secure access to server APIs and databases.

Server Components

Server Components operate entirely on the server, providing access to backend resources like databases for efficient data fetching without additional client-side processing. This approach allows the server to manage compute-intensive tasks and return only the necessary interactive code to the client.

React Server Components from Scratch
React Summit US 2023React Summit US 2023
29 min
React Server Components from Scratch
Top Content
Watch video: React Server Components from Scratch
This Talk introduces React Server Components and provides a step-by-step guide on building and rendering them. It explores the capabilities of server components, including interactivity and streaming. The Talk also covers the process of incorporating client-side rendering and the challenges of bundling and mapping client components. Additionally, it discusses the importance of supporting React Server Components and the ongoing efforts to integrate them with different bundlers.

Ben Holmes demonstrated how to build a server component from scratch in his talk "React Server Components from Scratch" at React Summit US 2023, helping developers understand the underlying mechanisms that enable RSC. Holmes built a Node server, connected the RSC renderer by hand, and explained the bundling and routing logic needed to ship a server component to the browser, demystifying how RSCs work outside of frameworks like Next.js.

Advantages of Server Components

The architecture of Server Components presents several key benefits:

  • Enhanced Performance: Server-side data fetching improves overall application performance
  • Improved Security: Sensitive data remains on the server, reducing exposure to potential attacks
  • Streamlined Development: As developers gain experience, the appropriate use of Server vs. Client Components becomes more intuitive

Features

Data Fetching

RSC optimizes data fetching by enabling developers to move this logic closer to the data source on the server. This significantly enhances performance by reducing the time required to fetch data and prepare it for rendering.

Jerel Miller and Alessia Bellisario explored how this works with GraphQL in their presentation "GraphQL in the World of React Server Components" at React Advanced 2024, demonstrating how to best separate data responsibilities between server and client components. They showed that when using client components, it's important to separate data to avoid synchronization issues, and emphasized best practices like fetching and consuming data that may change while avoiding overlapping data between server and client components.

Streaming

One of the notable features of RSC is streaming, which allows for progressive rendering of the user interface directly from the server. Work is split into chunks and streamed to the client as it becomes ready, enabling users to see parts of the page immediately without waiting for the entire content to finish rendering.

Mauro Bartolomeoli explored this concept deeply in his talk "Meet React Flight and Become a RSC Expert" at React Day Berlin 2024, introducing the React Flight protocol which enables streaming and other RSC features. Bartolomeoli explained that "React Streaming Components introduces the streaming concept and allows for continuous updates of the page," making it a game-changer for dynamic content.

Caching and Performance

RSC introduces caching capabilities by rendering on the server, allowing results to be cached and reused across multiple requests and users. This improves performance and reduces operational costs associated with rendering and data fetching for each request.

Maurice de Beijer discussed these optimizations in his workshop "React Server Components Unleashed: A Deep Dive into Next-Gen Web Development" at React Day Berlin 2023, explaining that "Next.js has a router cache that works on the client to prevent unnecessary requests to the server." He demonstrated how to control the cache using Next.js APIs to ensure updated data is immediately reflected in the application.

Server Actions

React 19 introduced Server Actions, allowing developers to execute code on the server and manage form data submissions directly from client components. Daishi Kato provided an in-depth explanation in his talk "How an RSC Framework Enables Server Actions" at React Advanced 2024, showing how server functions are implemented in frameworks through code transformation.

Kato explained, "Server functions allow the client component to call a function on the server. Server function and client component are both functions that need to be serializable." He demonstrated how framework developers must transform user code for different situations to enable this functionality, making server actions a non-trivial but powerful feature.

Usage

Best Practices

To leverage the full capabilities of React Server Components, developers should follow best practices, including using the "use client" directive to explicitly mark components requiring client-side rendering. This demarcation optimizes the bundle size and improves load times.

Practice TypeScript Techniques Building React Server Components App
TypeScript Congress 2023TypeScript Congress 2023
131 min
Practice TypeScript Techniques Building React Server Components App
Premium
This Workshop covers a variety of TypeScript techniques, including type checking, compiling code, using operator satisfies, creating type mappings, manipulating types with template literal strings, and using opaque types for type safety. It also introduces Next.js and React Server Components for server-side rendering and direct data fetching. The importance of type checking and CI setup is emphasized, along with the use of satisfies and pick operators. Custom type mappings and their applications are explored, as well as the use of opaque types and type assertions for better type checking. The workshop also highlights the benefits of preventing undefined errors and using strict options in TypeScript.

Maurice de Beijer shared valuable TypeScript-specific insights in his workshop "Practice TypeScript Techniques Building React Server Components App" at TypeScript Congress 2023, showing how to maintain type safety while building RSC applications. De Beijer emphasized the importance of type checking and setting up CI processes to catch errors early, along with using the satisfies operator and opaque types for better type safety in React Server Components.

Developers should be cautious of cascading dependencies, as importing client components into server components can inadvertently bloat the client bundle. The general recommendation is to:

  1. Start server-first and only switch to client components when interactivity is needed
  2. Structure applications with server components forming the foundation and client components added for specific interactive features
  3. Be mindful of component boundaries and ensure proper data flow between server and client components
  4. Optimize data fetching by accessing data as close as possible to where it's needed

Real-World Applications

React Server Components are particularly beneficial for:

  1. E-commerce platforms: Where speed and SEO are paramount
  2. Content-driven sites: Such as blogs and news portals
  3. Dynamic applications: That require real-time data fetching and rendering
Hydrogen: An Early Look at Server Components in the Wild
React Advanced 2022React Advanced 2022
7 min
Hydrogen: An Early Look at Server Components in the Wild
Hydrogen and server components are being used by big merchants in production sites to build headless storefronts quickly. React 18 introduces server components that allow for interactive rendering without adding anything to the bundle. However, not all libraries are compatible and data fetching can slow down the site, but React provides suspense to handle heavy components. Server components offer great encapsulation and fast rendering via HTML, and the future of headless is promising with technologies like Edgeworkers and hosting platforms like Oxygen. Shopify is hiring and offers a demo shop with server components at addogen.new.

Daniel Rios Pavia shared early implementation examples in his talk "Hydrogen: An Early Look at Server Components in the Wild" at React Advanced 2022, demonstrating how Shopify's Hydrogen framework used RSC to build headless storefronts quickly. Pavia reported that "big merchants [are] using [RSC] in production sites" and that "Hydrogen allows you to build a headless storefront quickly," showing the real-world applicability of the technology.

Framework Support

While React Server Components are a core part of React, most developers encounter them through frameworks that provide the necessary infrastructure. Next.js has been at the forefront of RSC adoption, particularly with its App Router implementation, but other frameworks are also incorporating this technology.

When discussing React Server Components, it's important to understand that they are distinct from framework-specific implementations. As Ben Holmes explained in his talk, "you might even ask if NextJS and server components are the same thing (spoiler: they're not!)". This distinction helps developers understand the portable nature of the technology beyond any single framework.

Beyond the Web

Bringing React Server Components to React Native
React Day Berlin 2023React Day Berlin 2023
29 min
Bringing React Server Components to React Native
Top Content
Watch video: Bringing React Server Components to React Native
React Server Components (RSC) offer a more accessible approach within the React model, addressing challenges like big initial bundle size and unnecessary data over the network. RSC can benefit React Native development by adding a new server layer and enabling faster requests. They also allow for faster publishing of changes in mobile apps and can be integrated into federated super apps. However, implementing RSC in mobile apps requires careful consideration of offline-first apps, caching, and Apple's review process.

Interestingly, RSC isn't limited to web applications. Szymon Rybczak explored extending this technology to mobile development in his talk "Bringing React Server Components to React Native" at React Day Berlin 2023, showing how RSC can benefit React Native by adding a server layer and enabling faster requests.

Rybczak explained that RSC in React Native can enable "faster publishing of changes in mobile apps" and be integrated into "federated super apps." He discussed challenges specific to the mobile context, such as Apple's review process and considerations for offline-first applications, providing valuable insights for developers looking to extend RSC beyond traditional web applications.

Performance

React Server Components significantly enhance performance through several mechanisms:

Improved Initial Load

Server Components accelerate the initial page load and First Contentful Paint by generating HTML directly on the server. This eliminates delays associated with downloading, parsing, and executing JavaScript on the client side.

As Nikhil Sharma explained in his talk, this approach is "better for initial page load and provides content faster" compared to client-side rendering. The server-side rendering in RSC enables the generation of HTML that allows users to view content immediately, enhancing the initial page load experience.

Reduced JavaScript Payload

One of the most significant performance benefits of RSC is the reduction in JavaScript sent to the client. As Aashima Ahuja emphasized, server components "add 0 kb to the client bundle," which is particularly beneficial for users with slower internet connections or less powerful devices.

By shifting non-interactive elements of the UI to Server Components, developers can significantly decrease the amount of client-side JavaScript required, resulting in faster load times and improved runtime performance.

Enhanced User Experience

The transition of rendering to the server improves speed and overall user experience by reducing request latency. This allows users to see parts of the page sooner, providing a smoother and more responsive interaction.

Tejas Kumar demonstrated in his talk how "soft navigation with server components enables re-rendering without hard navigation," significantly improving the perceived performance of applications by maintaining state and avoiding full page reloads.

SEO Benefits

An additional performance-related advantage is improved Search Engine Optimization. The server-rendered HTML is fully accessible to search engine bots, enhancing page indexability and potentially improving search rankings.

This benefit is particularly valuable for content-driven sites and e-commerce platforms, where search visibility directly impacts business outcomes. The ability to deliver fully-rendered content to search engines without relying on their JavaScript execution capabilities can lead to better indexing and higher rankings.

Challenges

Despite their benefits, React Server Components present several challenges for developers:

Non-Reactive Nature of Server Components

One fundamental challenge is the non-reactive nature of Server Components. Once rendered on the server, these components don't re-render dynamically, which can complicate scenarios requiring real-time updates or state changes based on user interactions.

Developers need to carefully consider which parts of their application require interactivity and plan their component architecture accordingly, ensuring that components needing reactivity are properly marked as client components.

Component Structure and File Management

Implementing progressive enhancements can require reorganizing components across multiple files. While the rest of a form may remain unchanged, relocating buttons that use client-side hooks to separate files can disrupt code cohesiveness and introduce complexity in file management.

Maurice de Beijer discussed this challenge in his workshop, showing how components that utilize client-side hooks (e.g., useFormStatus) often need to be relocated to separate files, which "can be mildly annoying" but necessary for proper separation of server and client concerns.

Learning Curve and Mental Model

Adopting RSC requires developers to rethink their approach to building React applications. The distinction between server and client components, along with the rules governing their interaction, introduces additional cognitive load.

As Mark Dalgleish noted, however, maintaining a simple mental model of how React works can help developers navigate this complexity. Understanding components as pure functions that describe what should be on the screen provides a foundation for comprehending how RSC extends this model to the server.

Data Management

Traditional approaches often require fetching all necessary data at once for multiple components, leading to prop drilling. While Server Components aim to resolve these issues by allowing data fetching directly within the needed component, this shift requires adapting to new paradigms in data management.

Jerel Miller and Alessia Bellisario addressed this challenge in their talk, recommending best practices such as "separating data to avoid synchronization issues" and "avoiding overlapping data between server and client components" to create more maintainable applications.

Community and Ecosystem

React Server Components have fostered a vibrant community focused on optimizing data-fetching and application performance. The React community has embraced these innovations, with frameworks like Next.js adopting many RSC features.

The ongoing development reflects a broader philosophy prioritizing efficient APIs for form handling, data-fetching, and reduced client-side JavaScript bundle sizes. This approach centers on Progressive Enhancement and server-side rendering, ultimately enhancing user experiences and application performance.

Several frameworks and libraries have been developed to facilitate better data management within RSC. Relay and GraphQL provide alternatives where components can define their data-fetching needs while delegating the actual fetching to a separate system, as demonstrated by Jerel Miller and Alessia Bellisario in their talk on GraphQL integration with RSC.

Daishi Kato, known for creating popular state management libraries like Zustand and Jotai, has been working on Waku, a framework focused on React Server Components. In his talk, he explained how Waku supports server functions and the challenges of implementing them. This exemplifies how experienced React developers are investing in the RSC ecosystem, creating tools to make adoption easier.

The React team itself continues to improve RSC capabilities. As Kent C. Dodds noted in his presentation, features like async components and streaming are becoming more robust, opening new possibilities for developers. The community's experimentation and knowledge sharing around these features contributes to the evolving landscape of React applications.

Ben Holmes emphasized the importance of supporting React Server Components across the ecosystem: "React server components should be supported by anyone using React or major frameworks. It will shape the ecosystem, and many libraries are transitioning to use server components." This sentiment reflects the growing recognition of RSC as a foundational technology rather than an optional feature.

09 May, 2025

FAQ

React Server Components (RSC) are a feature in React 18 that allow components to be rendered on the server, reducing the client-side JavaScript bundle and improving performance.

RSC improves performance by offloading heavy computation to the server, reducing client-side load and enhancing user experience.

Yes, RSC can be integrated with frameworks like Next.js to efficiently manage data fetching and server-side rendering.

Real-world applications include Shopify's Hydrogen framework, which uses RSC to build headless storefronts, enhancing rendering speed and user experience.

RSC can improve SEO by reducing client-side bundle sizes and allowing server-side rendering, which enhances page load speed and search engine visibility.

Learn more about the topic from these talks

Hydrogen: An Early Look at Server Components in the Wild
React Advanced 2022React Advanced 2022
7 min
Hydrogen: An Early Look at Server Components in the Wild
Hydrogen and server components are being used by big merchants in production sites to build headless storefronts quickly. React 18 introduces server components that allow for interactive rendering without adding anything to the bundle. However, not all libraries are compatible and data fetching can slow down the site, but React provides suspense to handle heavy components. Server components offer great encapsulation and fast rendering via HTML, and the future of headless is promising with technologies like Edgeworkers and hosting platforms like Oxygen. Shopify is hiring and offers a demo shop with server components at addogen.new.
Zero Bundle Size Server Components
React Advanced 2022React Advanced 2022
17 min
Zero Bundle Size Server Components
React Server Components is a recent feature introduced with the React team and launched with Next.js 12. They allow for rendering components on the server, improving performance and data fetching. Server components can be used alongside client-side rendering and provide direct access to server resources. However, they are still in the experimental stage and have some limitations, such as not being able to use hooks or event handlers. Challenges include importing server components in client components and making third-party API calls.
Server Components: The Epic Tale of Rendering UX
React Summit 2023React Summit 2023
26 min
Server Components: The Epic Tale of Rendering UX
Top Content
Watch video: Server Components: The Epic Tale of Rendering UX
This Talk introduces server components in React, which provide an intermediate format for rendering and offer advantages for both client-side and server-side rendering. Server components reduce bundle size on the client and improve search engine optimization. They abstract the rendering process, allowing for faster rendering and flexibility in choosing where to render components. While server components are still in the experimental stage, Next.js is a good starting point to try them out.
Simplifying Server Components
React Advanced 2023React Advanced 2023
27 min
Simplifying Server Components
Top Content
Watch video: Simplifying Server Components
React server components simplify server-side rendering and provide a mental model of components as pure functions. Using React as a library for server components allows for building a basic RSC server and connecting it to an SSR server. RSC responses are serialized virtual DOM that offload code from the client and handle interactivity. The client manifest maps serialized placeholders to real components on the client, enabling dynamic rendering. Server components combine the best of classic web development and progressive enhancement, offering the advantage of moving logic from the client to the server.
React Server Components from Scratch
React Summit US 2023React Summit US 2023
29 min
React Server Components from Scratch
Top Content
Watch video: React Server Components from Scratch
This Talk introduces React Server Components and provides a step-by-step guide on building and rendering them. It explores the capabilities of server components, including interactivity and streaming. The Talk also covers the process of incorporating client-side rendering and the challenges of bundling and mapping client components. Additionally, it discusses the importance of supporting React Server Components and the ongoing efforts to integrate them with different bundlers.
Server Components to the Rescue: Turbocharging and Empowering Your React Apps with Style
React Summit US 2023React Summit US 2023
16 min
Server Components to the Rescue: Turbocharging and Empowering Your React Apps with Style
Watch video: Server Components to the Rescue: Turbocharging and Empowering Your React Apps with Style
Welcome to the server components to the rescue, turbo charging and empowering your React application with style. React server components were introduced three years ago, providing an easy-to-maintain and quick-to-build solution with improved metrics and user experience. By using server-side rendering, there is no need to download code to the client at startup. Server components reduce the cost of attractions and provide a unified solution. The future of React server components includes improving state synchronization, allowing server components to re-render in response to state changes, and enabling fluid UI updates without page refresh.
Practice TypeScript Techniques Building React Server Components App
TypeScript Congress 2023TypeScript Congress 2023
131 min
Practice TypeScript Techniques Building React Server Components App
Workshop
Maurice de Beijer
Maurice de Beijer
In this hands-on workshop, Maurice will personally guide you through a series of exercises designed to empower you with a deep understanding of React Server Components and the power of TypeScript. Discover how to optimize your applications, improve performance, and unlock new possibilities.
 
During the workshop, you will:
- Maximize code maintainability and scalability with advanced TypeScript practices
- Unleash the performance benefits of React Server Components, surpassing traditional approaches
- Turbocharge your TypeScript with the power of Mapped Types
- Make your TypeScript types more secure with Opaque Types
- Explore the power of Template Literal Types when using Mapped Types
 
Maurice will virtually be by your side, offering comprehensive guidance and answering your questions as you navigate each exercise. By the end of the workshop, you'll have mastered React Server Components, armed with a newfound arsenal of TypeScript knowledge to supercharge your React applications.
 
Don't miss this opportunity to elevate your React expertise to new heights. Join our workshop and unlock the potential of React Server Components with TypeScript. Your apps will thank you.
Bringing React Server Components to React Native
React Day Berlin 2023React Day Berlin 2023
29 min
Bringing React Server Components to React Native
Top Content
Watch video: Bringing React Server Components to React Native
React Server Components (RSC) offer a more accessible approach within the React model, addressing challenges like big initial bundle size and unnecessary data over the network. RSC can benefit React Native development by adding a new server layer and enabling faster requests. They also allow for faster publishing of changes in mobile apps and can be integrated into federated super apps. However, implementing RSC in mobile apps requires careful consideration of offline-first apps, caching, and Apple's review process.
React Server Components Unleashed: A Deep Dive into Next-Gen Web Development
React Day Berlin 2023React Day Berlin 2023
149 min
React Server Components Unleashed: A Deep Dive into Next-Gen Web Development
Workshop
Maurice de Beijer
Maurice de Beijer
Get ready to supercharge your web development skills with React Server Components! In this immersive, 3-hour workshop, we'll unlock the full potential of this revolutionary technology and explore how it's transforming the way developers build lightning-fast, efficient web applications.
Join us as we delve into the exciting world of React Server Components, which seamlessly blend server-side rendering with client-side interactivity for unparalleled performance and user experience. You'll gain hands-on experience through practical exercises, real-world examples, and expert guidance on how to harness the power of Server Components in your own projects.
Throughout the workshop, we'll cover essential topics, including:- Understanding the differences between Server and Client Components- Implementing Server Components to optimize data fetching and reduce JavaScript bundle size- Integrating Server and Client Components for a seamless user experience- Strategies for effectively passing data between components and managing state- Tips and best practices for maximizing the performance benefits of React Server Components
React Server Components
React Day Berlin 2023React Day Berlin 2023
27 min
React Server Components
Watch video: React Server Components
React server components solve the problem of interrupting user interfaces caused by CPU-bound or network-bound web applications. They allow for read-only content to be rendered on the server and interactive elements to be shipped to the client, reducing code shipped and improving performance. Server-side rendering and server-side fetching improve the user experience by reducing delays and flash of unstyled content. Soft navigation with server components enables re-rendering without hard navigation, and using frameworks like Next.js helps with debugging and deployment challenges.
And Now You Understand React Server Components
React Summit 2024React Summit 2024
27 min
And Now You Understand React Server Components
Top Content
In this Talk, Kent C. Dodds introduces React Server Components (RSCs) and demonstrates how to build them from scratch. He explains the process of integrating RSCs with the UI, switching to RSC and streaming for improved performance, and the benefits of using RSCs with async components. Dodds also discusses enhancements with streaming and server context, client support and loaders, server component rendering and module resolution, handling UI updates and rendering, handling back buttons and caching, and concludes with further resources for diving deeper into the topic.
How an RSC Framework Enables Server Actions
React Advanced 2024React Advanced 2024
25 min
How an RSC Framework Enables Server Actions
Top Content
I'm Daisuke Kato, an open source developer. I've developed React libraries like Zest, Jota, and Valsio. Now, I'm working on a new React framework, Waku. It's a team project that started a year and a half ago. Recently, we added support for server functions. This talk is about server functions and React Server Components (RSC), which allows running React on a server. RSC includes server components and functions and can render components at build time. It leverages serialization provided by a React library. Server components are an extension that allows rendering on the server and merging with client components. Let's explore the implementation with code. RSC allows the use of server and client components. The server serializes the client component into the RST payload. A client reference acts like a URL and is used to retrieve the actual client component. Creating a client reference involves code transformation. Server functions allow the client component to call a function on the server. Server function and client component are both functions that need to be serializable. Creating server references has multiple ways. The framework transforms user code for different situations. Waku now supports server functions. Supporting server function is a challenging task, but we've done it. Thank you for your talk.
GraphQL in the World of React Server Components
React Advanced 2024React Advanced 2024
25 min
GraphQL in the World of React Server Components
Jerel Miller
Alessia Bellisario
2 authors
Welcome to React Advanced 2024. Gerald Miller and Alessia Bellisario discuss the pairing of GraphQL and server components and its advantages. GraphQL combined with server components has been widely adopted, allowing for initial rendering on the server and optimizing performance. React Server Components introduce a new primitive for rendering on the server and executing server-only code. GraphQL serves as a unifying layer between microservices. Data fetching in client components involves setting up an Apollo Client instance and provider. Best practices include separating data, avoiding overlap between server and client components, and using the preload query component. Optimize network requests in React using suspense boundaries and avoiding multiple requests. Fragments in GraphQL help optimize data fetching for UI components. Use fragments and the defer directive to stream data incrementally. Add suspense boundaries, useSuspenseFragment hook, and deferred directives to optimize data fetching in React components. Combine React server components and GraphQL for streaming multi-part responses and enhancing user experiences.
Mastering React Server Components and Server Actions in React 19
React Summit US 2024React Summit US 2024
150 min
Mastering React Server Components and Server Actions in React 19
Featured Workshop
Maurice de Beijer
Maurice de Beijer
Calling all React developers! Join us for an immersive 4-hour workshop diving deep into React Server Components and Server Actions. Discover how these game-changing technologies are revolutionizing web development and learn how to harness their full potential to build lightning-fast, efficient applications.

Explore the world of React Server Components, seamlessly blending server-side rendering with client-side interactivity for unmatched performance and user experience. Dive into React Server Actions to see how they combine client-side interactivity with server-side logic, making it easier to develop interactive applications without traditional API constraints.

Get hands-on experience with practical exercises, real-world examples, and expert guidance on implementing these technologies into your projects. Learn essential topics such as the differences between Server and Client Components, optimizing data fetching, passing data effectively, and maximizing performance with new React hooks like useActionState, useFormStatus and useOptimistic.

Whether you're new to React or a seasoned pro, this workshop will equip you with the knowledge and tools to elevate your web development skills. Stay ahead of the curve and master the cutting-edge technology of React 19. Don't miss out - sign up now and unleash the full power of React!
Meet React Flight and Become a RSC Expert
React Day Berlin 2024React Day Berlin 2024
31 min
Meet React Flight and Become a RSC Expert
My name is Mauro and I work for a company called Doubleloop in Italy. Today, I'm going to share my learning journey through puzzles and challenges related to React Server Components (RSC). RSC allows for server-side rendering and streaming of components. React flight, a protocol used to serialize and share rendering jobs, is a key feature of RSC. RSC can be used without a server, known as React Serverless Components. Using RSC, different types of content can be switched using the useState hook. RSC can be effectively used on a server by starting Node.js with a specific flag. Client-only components recognized by RSC can be executed on the client. React Streaming Components introduces the streaming concept and allows for continuous updates of the page. Advanced features of React Streaming Components include asynchronous rendering, suspense, and recursion. The React Strange Constraints challenge focuses on optimizing rendering by sending the initial page as HTML. The use of a proxy and RSE payload allows for client hydration of RSC. The possibility of using languages other than JavaScript, such as Rust, for server components is explored. RSC has the potential to become a language-agnostic protocol. The meaning of client-server roles in RSC can be extended. RSC offers streaming capabilities and the ability to balance server and client work. Infinite streaming is possible with server sockets. RSC hydration is believed to be faster than regular hydration. The Talk concludes by encouraging questions during the Q&A session.