# Behavior traces — remix-run/react-router

> Canonical page: https://codevetter.com/unpack/react-router/behavior-traces

# Behavior traces — 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.

Four concrete flows were followed through source: browser startup, mutation submission, server document handling, and file session persistence. These traces describe call order and state transitions without asserting runtime success. Initialization and submissions converge on the shared navigation machinery. Server and persistence flows cross explicit adapter and serialization boundaries.
- Browser startup begins in playground/data/src/main.tsx: createBrowserRouter(route array) constructs the router before createRoot renders RouterProvider. — [playground/data/src/main.tsx#L6-24](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/playground/data/src/main.tsx#L6-L24) [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)
- Startup continues through createRouter → initialize → history.listen; when state is not initialized, initialize starts a POP navigation with initialHydration. — [packages/react-router/lib/router/router.ts#L1317-1321](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/router/router.ts#L1317-L1321) [packages/react-router/lib/router/router.ts#L1383-1405](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/router/router.ts#L1383-L1405)
- Initial loading enters startNavigation → createClientSideRequest → handleLoaders → completeNavigation, committing loader results for the playground Component to read. — [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) [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) [playground/data/src/main.tsx#L10-15](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/playground/data/src/main.tsx#L10-L15)
- Submission begins with useSubmit → getFormSubmissionInfo → router.navigate, or router.fetch when navigate is false. — [packages/react-router/lib/dom/lib.tsx#L2578-2611](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/dom/lib.tsx#L2578-L2611)
- Mutation navigation enters handleAction, interrupts active loads, updates navigation to submitting, and returns a 405 error when the targeted route has neither action nor lazy. — [packages/react-router/lib/router/router.ts#L2171-2180](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/router/router.ts#L2171-L2180) [packages/react-router/lib/router/router.ts#L2238-2250](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/router/router.ts#L2238-L2250)
- After the action, startNavigation builds loading navigation, calls handleLoaders, and commits action and loader results through completeNavigation. — [packages/react-router/lib/router/router.ts#L2096-2110](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/router/router.ts#L2096-L2110) [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 document handling follows createRemixRequest → getLoadContext → core handleRequest → handleDocumentRequest → staticHandler.query → renderHtml → sendRemixResponse. — [packages/react-router-express/server.ts#L53-59](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router-express/server.ts#L53-L59) [packages/react-router/lib/server-runtime/server.ts#L279-288](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/server-runtime/server.ts#L279-L288) [packages/react-router/lib/server-runtime/server.ts#L470-490](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/server-runtime/server.ts#L470-L490)
- The response path sets status and headers, flushes event-stream headers, streams the body, and cancels the body if the Express response is already closed. — [packages/react-router-express/server.ts#L134-166](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router-express/server.ts#L134-L166)
- New file-session persistence follows createFileSessionStorage → createSessionStorage → commitSession → createData → getFile → mkdir/writeFile → cookie.serialize. — [packages/react-router-node/sessions/fileStorage.ts#L31-55](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router-node/sessions/fileStorage.ts#L31-L55) [packages/react-router/lib/server-runtime/sessions.ts#L300-315](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/server-runtime/sessions.ts#L300-L315)
- A subsequent session read follows cookie.parse → readData → getFile → readFile/JSON.parse → expiry check → createSession; destroySession deletes backing data and expires the cookie. — [packages/react-router/lib/server-runtime/sessions.ts#L294-323](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router/lib/server-runtime/sessions.ts#L294-L323) [packages/react-router-node/sessions/fileStorage.ts#L61-84](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router-node/sessions/fileStorage.ts#L61-L84) [packages/react-router-node/sessions/fileStorage.ts#L96-110](https://github.com/remix-run/react-router/blob/a6090382ed467b5a2d46c8de1a13b331f14959f8/packages/react-router-node/sessions/fileStorage.ts#L96-L110)

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)
