1Time to Interactive
A common SSR problem is the 'Uncanny Valley'. The server sends the HTML, so the user sees the page (First Contentful Paint is fast). But the massive JS bundle is still downloading. The user clicks a button, and nothing happens. This gap between seeing the page and the page actually being interactive (Hydration) is a major performance metric you must optimize.
2Step-by-Step Breakdown
Beyond Syntax. A junior knows HOW to use React. A mid-level knows WHY React was chosen over Angular or Vue, and the architectural trade-offs of that decision.
The Virtual DOM. React uses a Virtual DOM. You must understand reconciliation and diffing. Why do we need 'key' props? Because the diffing algorithm uses them to optimize DOM updates.
Signals vs State. Modern frameworks (Solid, Vue, Svelte, Angular) are moving towards 'Signals'—fine-grained reactivity that updates the exact DOM node without re-rendering the whole component.
Server-Side Rendering (SSR). Frameworks like Next.js blur the line between front and back. You must understand Hydration, SSR, Static Site Generation (SSG), and when to use each for SEO and performance.
Knowledge Check. In a framework like Next.js, what is the primary benefit of Static Site Generation (SSG) over Client-Side Rendering (CSR)?
- →Better SEO and faster initial page load since HTML is pre-built
- →It allows for real-time WebSocket connections
Hydration. When SSR sends HTML, the browser shows it instantly. But it's static. 'Hydration' is the process of React booting up in the browser and attaching event listeners to that HTML.
State Management. When does Context API fail? Why use Redux, Zustand, or Jotai? Mid-levels understand that Context triggers re-renders for all consumers, while atomic state (Jotai) prevents this.
Micro-Frontends. For massive enterprise apps, you might split the frontend into 'Micro-Frontends' (e.g. using Module Federation) so different teams can deploy independently.
Data Fetching. Stop using useEffect for fetching. Understand tools like React Query, SWR, or Apollo. They handle caching, deduping, background updates, and optimistic UI.
Summary. Pick the right tool for the specific architectural problem.
