From the course: Master Next.js: Elaborate Hands-On Web Development, React Basics, Advanced Next.js, and Deployment

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

How server-side rendering works as a deeper dive

How server-side rendering works as a deeper dive

Let's go back, we're rewinding, to go back and get more specifically deeper with server-side rendering. We're talking about pre-rendering and server-side rendering as a subset of that. But what does server-side rendering really do? What it does is it creates the HTML for a page on a server every time the user makes a request. We've got that server-side render happening every time the user makes a request. This HTML, along with JSON data and JavaScript code for interactivity, so that's where you get the hydration, is subsequently transmitted to the client's browser. All right, so the JavaScript code is there for the interactivity, the JSON's there for the data and that HTML, and then you get that. But it gets rendered on the server side. Now, when it reaches the client side, the provided HTML quickly renders a non-interactive version of the page. So simultaneously, what React does is it'll utilize, it'll include the JSON data and the JavaScript to enhance components interactively, such…

Contents