Introduction

React typically uses client-side rendering (CSR). This means that it dynamically injects the HTML code in the target div (it generally uses the #app or #root IDs), and that's why if you try to see the page's code directly (right-click—View Page Code) you will see something like this:

The only way to see the actual code is by inspecting the site with Chrome Dev Tools, or other tools, and here is the code generated by React using CSR:

By inspecting the page, you can see the code that is injected into our #root div. Server-side rendering ...

Get React Cookbook 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.