Hands-on with React Server Components

by Becca Smith on Jul 18, 2022 Software 474 Views

React remains a flagship among front-end JavaScript frameworks, and the React team continues to pursue avenues to keep it relevant. One of the more important developments on the roadmap is React Server Components. 

React Server Components provide a means of offloading the work behind a component to the server. This avoids having to ship bundled JavaScript and having to serve secondary API requests to hydrate the component.

React Server Components are a preview feature that can be enabled in React 18. 

[ Also on InfoWorld: Hands-on with the Svelte JavaScript framework ]

Why use React Server Components

Before we look at how React Server Components will work, let’s think about why.  First, it’s useful to note that React Server Components are distinct from server-side rendering (SSR). As the RFC from the React team states,

[SSR and Server Components are] complementary. SSR is primarily a technique to quickly display a non-interactive version of client components. You still need to pay the cost of downloading, parsing, and executing those Client Components after the initial HTML is loaded.

So in contrast to SSR, where we are aiming to render out an initial version of a component which then behaves as a normal client-side animal, React Server Components intend to fully replace the client-side functionality with work done on the server. This has two main benefits:

  1. Bundled JavaScript doesn’t need to be shipped over the wire to the client. The JavaScript is imported and executed, and the results are consumed, on the server.
  2. Initial Ajax/API requests are not required to hydrate the component. The component can interact directly with back-end services to fulfill these needs.  This makes for a less chatty client and avoids the “waterfall of requests” sometimes seen as the browser fulfills interrelated data fetches.

Limitations of React Server Components


For more information check this popular resource.

Article source: https://article-realm.com/article/Computers/Software/25000-Hands-on-with-React-Server-Components.html

Comments

No comments have been left here yet. Be the first who will do it.
Safety

captchaPlease input letters you see on the image.
Click on image to redraw.

Reviews

Guest

Overall Rating:

Statistics

Members
Members: 17266
Publishing
Articles: 79,974
Categories: 202
Online
Active Users: 536
Members: 0
Guests: 536
Bots: 3471
Visits last 24h (live): 5363
Visits last 24h (bots): 39304

Latest Comments

Embarking on a peaceful yoga and Ayurveda retreat in India sounds like the ultimate way to achieve complete inner peace, stress relief, and total mental clarity. Too bad all that inner calm gets...
Finding a detailed global market report on recombinant cell culture supplements hidden away in a music directory is a wild plot twist, it almost as abrupt as running head-first into a sudden spike...
Exploring the majestic forts and royal history of India sounds like an incredible journey through timeless architecture. Too bad no amount of royal heritage can help you master the chaotic,...
This blog really convinced me to do it! Thanks, very good post  Jpbosku    
This blog really convinced me to do it! Thanks, very good post  Jpbosku    
Thanks for sharing these informations. I really like your blog post very much. You have really shared a informative and interesting blog post .    pakde4d    
I love the way you write and share your niche! Very interesting and different!    pakde4d    
Good to become visiting your weblog again, it has been months for me. Nicely this article that i've been waited for so long. I will need this post to total my assignment in the college, and it has...
This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information.. pakde4d  
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired...

Translate To: