Add React Router (framework mode) integration #88
Request#
Add React Router framework mode (react-router / @react-router/dev) as a supported integration, alongside TanStack Start, Vite, Vinext and Next.js.
Why#
React Router framework mode is a widely used way to build server-rendered React apps on Vite, and these apps would see the same client bundle savings Redact shows for the other frameworks. It already runs on Vite, so most of the work is likely verification rather than new plumbing.
What support could cover#
- A documented setup:
redact()(or a@tanstack/redact/react-routerentry) alongsidereactRouter()invite.config.ts, with the SSR runtime choice stated, as the Next.js and Vinext docs do. - Release checks like the Next.js and Vinext gates, covering server rendering and hydration, client navigation (including scroll restoration), loaders and actions with
<Form>and fetchers,useSyncExternalStore-based navigation state, and streaming with<Await>. - A note on known gaps. #87 (
useSyncExternalStorerouter invariant loop) and #59 (scroll-to-top dropped on client navigation) look relevant.
Our setup#
React Router 8.5 in framework mode, the @react-router/dev Vite plugin on Vite 8, server rendering through @react-router/express, and React 19.3. We're happy to try a pre-release integration and report back.
cr101(GitHub profile, opens in a new tab) changed the title
Thanks again for the clear setup details. Redact 0.3.1 is on npm now, and the Vite guide shows how to use Redact in the browser and keep native React on the server. If you try it in your app, I’d love to hear how it goes.
0.3.1 on npm · React Router setup
AI review notes: The agent verified the 0.3.1 artifact and ran the production fixture with React Router 8.5.0, Vite 8.3.4, and React 19.3.1 in Chromium, Firefox, and WebKit. The maintained production checks are still in #152, and this issue stays open while that coverage lands.
Thanks for the clear setup and the list of cases to cover. Redact 0.3.1 is on npm, and the Vite guide shows how to use Redact in the browser and keep native React on the server.
The checks on main now cover production SSR and hydration, navigation and scroll restoration, loaders, forms, fetchers, streaming, and state-preserving development refresh. I’m closing this as shipped. If you run into a gap in your app, please reopen this or share a fresh repro and I’ll take a look.
tannerlinsley closed this
Sign in to join this conversation.
Thanks for the clear integration request, the Vite environment selection and native React type support are now merged in #148. The package release is still pending. Keeping this open for the maintained React Router framework coverage.