@react-router/serve
Advanced tools
Changelog
v7.5.1
Date: 2025-04-17
react-router
- When using the object-based route.lazy
API, the HydrateFallback
and hydrateFallbackElement
properties are now skipped when lazy loading routes after hydration (#13376)
If you move the code for these properties into a separate file, since the hydrate properties were unused already (if the route wasn't present during hydration), you can avoid downloading them at all. For example:
createBrowserRouter([
{
path: "/show/:showId",
lazy: {
loader: async () => (await import("./show.loader.js")).loader,
Component: async () =>
(await import("./show.component.js")).Component,
HydrateFallback: async () =>
(await import("./show.hydrate-fallback.js")).HydrateFallback,
},
},
]);
react-router
- Fix single fetch bug where no revalidation request would be made when navigating upwards to a reused parent route (#13253)
react-router
- Properly revalidate pre-rendered paths when param values change when using ssr:false
+ prerender
configs (#13380)
react-router
- Fix pre-rendering when a loader returns a redirect (#13365)
react-router
- Do not automatically add null
to staticHandler.query()
context.loaderData
if routes do not have loaders (#13223)
undefined
from loaders, our prior check of loaderData[routeId] !== undefined
was no longer sufficient and was changed to a routeId in loaderData
check - these null
values can cause issues for this new checkcreateStaticHandler()
/<StaticRouterProvider>
, and using context.loaderData
to control <RouterProvider>
hydration behavior on the client⚠️ Unstable features are not recommended for production use
react-router
- Add better error messaging when getLoadContext
is not updated to return a Map
(#13242)react-router
- Update context type for LoaderFunctionArgs
/ActionFunctionArgs
when middleware is enabled (#13381)react-router
- Add a new unstable_runClientMiddleware
argument to dataStrategy
to enable middleware execution in custom dataStrategy
implementations (#13395)react-router
- Add support for the new unstable_shouldCallHandler
/unstable_shouldRevalidateArgs
APIs in dataStrategy
(#13253)Full Changelog: v7.5.0...v7.5.1