How remix-run/react-router works
React Router is a multi-strategy React routing product, usable as a library or as a full-stack framework. In the central runtime workflow, a user initiates navigation, router APIs and hooks coordinate routing, and framework route modules supply rendering and data behavior. Framework capabilities also include route configuration, development tooling, server adapters, and project creation. The graph emphasizes the core and documented package boundaries; some internal runtime connections are supported only by the source index, so unsampled implementation details are not expanded.
Main entry points: entry.ts SSR entry context · hooks.tsx Navigation hooks · routes.tsx Framework routes · router.ts Navigation engine
Components 18
Router runtime
- Router APIs
packages/react-router/lib/components.tsx - Navigation hooks
packages/react-router/lib/hooks.tsx - Navigation engine
packages/react-router/lib/router/router.ts - History management
packages/react-router/lib/router/history.ts
Framework rendering
- Framework routes
packages/react-router/lib/dom/ssr/routes.tsx - Route modules
packages/react-router/lib/dom/ssr/routeModules.ts - SSR entry context
packages/react-router/lib/dom/ssr/entry.ts - Route discovery
packages/react-router/lib/dom/ssr/route-discovery.ts - Server build data
packages/react-router/lib/server-runtime/build.ts
Route configuration
- Route config
packages/react-router-dev/config/routes.ts - Filesystem routes
packages/react-router-fs-routes/flatRoutes.ts - Vite tooling
packages/react-router-dev/vite/plugin.ts
Server platforms
- Node adapter
packages/react-router-node/server.ts - Express adapter
packages/react-router-express/server.ts - Cloudflare adapter
packages/react-router-cloudflare/worker.ts - Web server
packages/react-router-serve/cli.ts
Project setup
- Project creation
packages/create-react-router/cli.ts
Other components
- App user
Connections 18
- App user → Router APIs: uses routing
README.md - Router APIs → Navigation hooks: exposes hooks
packages/react-router/lib/hooks.tsx - Navigation hooks → Navigation engine: uses engine
packages/react-router/lib/hooks.tsx - Navigation hooks → History management: uses history
packages/react-router/lib/hooks.tsx - SSR entry context → Route discovery: uses discovery
packages/react-router/lib/dom/ssr/entry.ts - SSR entry context → Navigation engine: uses router
packages/react-router/lib/dom/ssr/entry.ts - SSR entry context → Framework routes: uses routes
packages/react-router/lib/dom/ssr/entry.ts - SSR entry context → Route modules: uses modules
packages/react-router/lib/dom/ssr/entry.ts - SSR entry context → Server build data: uses build data
packages/react-router/lib/dom/ssr/entry.ts - Framework routes → Route modules: loads modules
packages/react-router/lib/dom/ssr/routes.tsx - Framework routes → Navigation engine: uses matching
packages/react-router/lib/dom/ssr/routes.tsx - Route config → Vite tooling: configures framework
- Filesystem routes → Route config: supplies routes
- App user → Project creation: creates project
README.md - App user → Node adapter: uses adapter
README.md - App user → Express adapter: uses adapter
README.md - App user → Cloudflare adapter: uses adapter
README.md - App user → Web server: uses server
README.md