liveBook · Manning

Routing

As explained in Acing the Frontend Interview

Routing maps application locations or URLs to the interface content and behavior displayed for them.

Routing maps application paths to the views and behavior displayed for them. In React applications, it supports client-side navigation and connects route design with CSR, SSR, SSG, performance, SEO, and scalability. section 5.1

Expect interview questions about how routing is organized and why a particular strategy fits the application:

  • Basic routes map paths such as /, /about, and /contact to components, with a fallback for unmatched URLs. section 5.1
  • Nested routes compose shared layouts with child content through an Outlet, as in /users, /users/:userId, and /users/new. section 5.1
  • Protected routes check authentication before rendering child routes and redirect unauthenticated users to /login. section 5.1
  • Route architecture affects rendering and delivery: Vite commonly starts with CSR, while mega-frameworks provide routing alongside CSR, SSR, SSG, hybrid rendering, and data-fetching features. section 5.1

Interview scenario: choosing a routing approach

A candidate building a small React application can use Vite with React Router for manual client-side routes. As the application grows, the candidate should discuss nested and protected routes, route parameters, lazy loading, code-splitting, and prefetching. For a production-grade application requiring built-in SSR, SSG, API support, or full-stack routing, a mega-framework may reduce boilerplate. A strong answer explains the trade-off rather than treating one router as universally best. section 5.1 section 5.5

Table 5.1 Progressive skills in React routing and mega-frameworks
Topic
Fundamentals
Applied skills
Advanced
Routing
Explain routing basics: client-side navigation, file-based routing, and CSR vs SSR concepts.
Use React Router for client-side routing. Build nested routes, protected routes, and handle route parameters for dynamic navigation flows.
Architect advanced routing systems with code-splitting, lazy loading, and prefetching strategies. Optimize route transitions for large-scale applications.
Project scaffolding
Set up projects with Vite. Understand differences in build tools and development servers.
Configure Vite for faster builds and hot module replacement (HMR). Replace CRA with Vite in existing projects for performance gains.
Customize Vite for enterprise workflows with monorepo support, advanced plugin ecosystems, and optimized build pipelines.
Mega-
frameworks
Explore Next.js, React Router (Remix), and Astro fundamentals. Understand their approaches to routing, rendering, and data fetching.
Implement SSR and SSG with Next.js. Configure API routes, dynamic/static paths, and incremental static regeneration (ISR). Use React Router (Remix) for loader actions and nested routes.
Design hybrid rendering architectures with React Server Components (RSC) and Suspense. Apply edge rendering and multi-region deployments for global scalability.

Use the progressive-skills table to compare routing fundamentals, applied React Router work, and advanced optimization through code-splitting, lazy loading, and prefetching. section 5.1

How Acing the Frontend Interview covers it

How deep it goes
Explains basic, nested, protected, and parameterized routes, then points toward lazy loading and prefetching without implementing advanced optimization.
Examples
Uses home, about, contact, nested user, dynamic profile, new-user, protected, login, and unmatched-route examples.
What it assumes
Assumes React, JavaScript or TypeScript, components, and basic web development while reinforcing React-specific routing choices.
What you can do after
Apply routing via React Router and evaluate CSR, SSR, SSG, and mega-framework choices for scalable applications.
How it connects
Connects React Router with client-side rendering, server-side rendering, static site generation, Vite, Next.js, Remix, and Astro.

Also explained in

Compare how 34 books explain routing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Frontend Interview. The section links point to the parts of the book it draws on.