From the course: React: Ecosystems

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Server-side rendering

Server-side rendering - React.js Tutorial

From the course: React: Ecosystems

Server-side rendering

- Let's talk next about server side rendering. Think about what happens when you browse the web you type a URL into your browser and an application or website loads. So where does this app, or website render? On the server, where it is usually hosted or, on your browser, commonly called a client. Well it turns out both are right. Depending on the application some are rendered on the server, and some on the client. It means that grabbing all your code and presenting the final HTML can be done on both sides. What are the benefits of rendering on the service side? It depends on multiple factors. But, the short answer is that it can make your application run faster, be more secure, and SEO friendly. So how about doing this in React? There are multiple ways to do this. But the simplest way to get started is to use ReactDomserver AVIs provided with React's core library. You can use the render to string method in the server code or if you want the static HTML without the extra attributes you…

Contents