Posts

Showing posts from February, 2025

The Evolution of Rendering in React: From Client-Side to Server Components

  🚀 The Evolution of Rendering in React: From Client-Side to Server Components React has evolved massively in how it renders pages, moving from Client-Side Rendering (CSR) to Server Components (RSC) to improve performance, SEO, and user experience. Let's break this down step by step: 🔥 1️⃣ Client-Side Rendering (CSR) – The Beginning 📌 What is CSR? In Client-Side Rendering (CSR) , the browser downloads a bare HTML file and a JavaScript bundle . React runs entirely in the browser , generating the UI dynamically. 📌 How it Works? Browser downloads an empty HTML file . Loads a large JavaScript bundle containing React code. React renders components dynamically and updates the DOM. 📌 Example: CSR in React (Create React App) function App ( ) { return < h1 > Hello, world! </ h1 > ; } export default App ; The entire app loads and renders in the browser . No content is present in the initial HTML file. 📌 Challenges of CSR: ❌ Slow First Page Load – A blank page ...