Chapter 6. Server-Side React
React has evolved considerably since its inception. Although it started as a client-side library, the demand for server-side rendering (SSR) has grown over time for reasons we will come to understand in this chapter. Together, we will explore server-side React and understand how it differs from client-only React, and how it can be used to level up our React applications.
As we’ve discussed in earlier chapters, React was initially developed by Meta to address the need for efficient and scalable UIs. In Chapter 3 we looked at how it does this through the virtual DOM, which enables developers to create and manage UI components with ease. React’s client-side approach unlocked fast, responsive user experiences across the web. However, as the web continued to evolve, the limitations of client-side rendering became more apparent.
Limitations of Client-Side Rendering
Client-side rendering (CSR) has been the primary approach for building user interfaces with React since it was first released as open source software in 2013. Eventually, a number of limitations with this approach started to appear. These limitations eventually led to us moving more and more concerns to the server side.
SEO
One of the significant limitations of client-side rendering is that search engine crawlers may not correctly index the content, as some of them do not execute JavaScript, or those that do execute JavaScript may not execute it as we expect.
Given the wide variety of search ...
Get Fluent React now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.