# Data flow — remix-run/react-router

> Canonical page: https://codevetter.com/unpack/react-router/data-flow

# Data flow — remix-run/react-router

Scanned commit a6090382ed467b5a2d46c8de1a13b331f14959f8 (2026-09-30). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Route configuration becomes normalized route objects and runtime matching state. Browser submissions become Fetch Requests whose results update route data and errors. Server adapters convert platform inputs into the same request abstraction and return streamed responses. Session data follows a separate cookie-to-storage lifecycle controlled by application code.
- createBrowserRouter feeds route objects, browser history, and hydration data into createRouter before initialization. — [packages/react-router/lib/dom/lib.tsx#L647-664](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/dom/lib.tsx#L647-L664)
- navigate resolves relative targets through normalizeTo and transforms navigation options into a path, submission, or error. — [packages/react-router/lib/router/router.ts#L1720-1732](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/router/router.ts#L1720-L1732)
- startNavigation aborts the previous navigation, matches the new location, and creates a Request with an AbortController signal. — [packages/react-router/lib/router/router.ts#L1944-1967](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/router/router.ts#L1944-L1967) [packages/react-router/lib/router/router.ts#L2029-2040](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/router/router.ts#L2029-L2040)
- Mutation submissions run handleAction before handleLoaders; completion commits action data, loader data, errors, and working fetchers. — [packages/react-router/lib/router/router.ts#L2052-2068](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/router/router.ts#L2052-L2068) [packages/react-router/lib/router/router.ts#L2116-2155](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/router/router.ts#L2116-L2155)
- Express copies request headers, streams non-GET/HEAD bodies into Fetch Requests, and aborts when the response closes before finishing. — [packages/react-router-express/server.ts#L68-85](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router-express/server.ts#L68-L85) [packages/react-router-express/server.ts#L111-131](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router-express/server.ts#L111-L131)
- Document rendering collects loaderData, actionData, and sanitized errors into a Turbo Stream handoff alongside build metadata. — [packages/react-router/lib/server-runtime/server.ts#L504-545](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/server-runtime/server.ts#L504-L545)
- callRouteHandler forwards request, URL, params, context, and route pattern, converting redirect data wrappers into thrown Responses. — [packages/react-router/lib/server-runtime/data.ts#L11-33](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/server-runtime/data.ts#L11-L33)
- getSession parses a cookie identifier and reads backing data; commitSession updates or creates backing data and serializes the identifier. — [packages/react-router/lib/server-runtime/sessions.ts#L294-315](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/server-runtime/sessions.ts#L294-L315)
- File sessions serialize data and expiry as JSON, generate random hexadecimal IDs, and remove expired data during reads. — [packages/react-router-node/sessions/fileStorage.ts#L37-84](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router-node/sessions/fileStorage.ts#L37-L84)
- Type generation creates context, clears the generated type directory, and writes generated server-build and route files. — [packages/react-router-dev/typegen/index.ts#L24-39](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router-dev/typegen/index.ts#L24-L39)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
