Skip to content

Client Side rendering

Course: CSR vs SSR vs SSG - chapter 1

Client-side rendering (CSR) is a modern technique used in web development where the rendering of a webpage is performed in the browser using JavaScript. Instead of the server sending a fully rendered HTML page to the client

Good example of CSR - React

Let’s see a react project in action

  • Initialise a react project
npm create vite@latest
  • Add dependencies
npm i
  • Start the project
npm run build
  • Serve the project
cd dist/
serve

Open the network tab and notice how the inital HTML file deosn’t have any content

This means that the JS runs and actually populates / renders the contents on the page

React (or CSR) makes your life as a developer easy. You write components, JS renders them to the DOM.

  1. Not SEO optimised
  2. User sees a flash before the page renders
  3. Waterfalling problem