Files
MD YUNUS b89afe0736 fix: wire up RouterContext.Provider in Pages Router (#239) (#249)
Add wrapWithRouterContext() function to the next/router shim that wraps
any React element in a <RouterContext.Provider>. This is the root-cause
fix: it builds the router value object directly from the SSR context
(server) or window.location + Router singleton (client) — no hooks, no
duplicate state, no extra component.

This provides a single source of truth for the router context value,
matching how Next.js provides RouterContext at the framework level.

Wrapping sites:
- dev-server.ts: main render, ISR re-render, error page render
- index.ts virtual module: production renderPage and ISR re-render
- Hydration script: client-side hydration entry
- navigateClient: client-side navigation re-renders

Tests:
- useRouter returns null without provider (default/App Router)
- useRouter returns full router when wrapWithRouterContext wraps tree
- useRouter reflects SSR context (pathname, query, asPath)
- wrapWithRouterContext is exported from next/router

Closes #239
2026-03-04 22:12:29 +00:00
..
2026-02-24 09:29:39 -06:00
2026-02-24 09:29:39 -06:00
2026-02-24 09:29:39 -06:00
2026-02-24 09:29:39 -06:00
2026-02-24 09:29:39 -06:00