React server components (RSC) is an exciting new feature that will have huge implications on page load performance, bundle size, and how we write Reac

How React server components work: an in-depth guide

submited by
Style Pass
2022-01-20 20:00:11

React server components (RSC) is an exciting new feature that will have huge implications on page load performance, bundle size, and how we write React applications in the near future. We at Plasmic make a visual builder for React, and we care a lot about React performance — many of our customers use Plasmic to build performance-critical marketing and e-commerce sites. And so, even though RSC is still an early experimental feature in React 18, we have been digging into how it works under the hood. In this blog post, we’re excited to share what we’ve learned!

React Server Components allows the server and the client (browser) to collaborate in rendering your React application. Consider the typical React element tree that is rendered for your page, which is usually composed of different React components rendering more React components. RSC makes it possible for some components in this tree to be rendered by the server, and some components to be rendered by the browser 🤯

Here’s a quick illustration from the React team, showing what the end goal is: a React tree, where the orange components rendered on the server, and blue components are rendered on the client.

Leave a Comment