Packages

react-router

8.5.1 · 27 Oct 2026MIT80.5M / weekRepositorynpmAtom feed

Your version

7.5.1

17 Apr 2025Where it was published

7.18.6 is the newest release of 7.x.

In short

3 new6 fixed

Security

15 advisories affect 7.5.1; 7.18.0 fixes them

10 more

Release note

The section about react-router of a note shared by several packages.

Patch Changes

  • Fix single fetch bug where no revalidation request would be made when navigating upwards to a reused parent route

  • When using the object-based route.lazy API, the HydrateFallback and hydrateFallbackElement properties are now skipped when lazy loading routes after hydration.

    If you move the code for these properties into a separate file, you can use this optimization to avoid downloading unused hydration code. 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,
        },
      },
    ]);
  • Properly revalidate prerendered paths when param values change

  • UNSTABLE: Add a new unstable_runClientMiddleware argument to dataStrategy to enable middleware execution in custom dataStrategy implementations

  • UNSTABLE: Add better error messaging when getLoadContext is not updated to return a Map"

  • Do not automatically add null to staticHandler.query() context.loaderData if routes do not have loaders

    • This was a Remix v2 implementation detail inadvertently left in for React Router v7

    • Now that we allow returning 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 check

    • ⚠️ This could be a "breaking bug fix" for you if you are doing manual SSR with createStaticHandler()/<StaticRouterProvider>, and using context.loaderData to control <RouterProvider> hydration behavior on the client

  • Fix prerendering when a loader returns a redirect

  • UNSTABLE: Update context type for LoaderFunctionArgs/ActionFunctionArgs when middleware is enabled

  • Add support for the new unstable_shouldCallHandler/unstable_shouldRevalidateArgs APIs in dataStrategy

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.