šŸš€ Socket Launch Week šŸš€ Day 5: Introducing Socket Fix.Learn More →
Socket
Sign inDemoInstall
Socket

react-router

Package Overview
Dependencies
Maintainers
4
Versions
771
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router - npm Package Versions

2345
…
77

7.5.2

Diff
mjackson
published 7.5.2 •
mjackson
published 0.0.0-nightly-8e4963fae-20250424 •
mjackson
published 0.0.0-experimental-1a5899f7e •
mjackson
published 0.0.0-experimental-3b3f4b74e •
mjackson
published 0.0.0-experimental-856ae8c29 •
mjackson
published 0.0.0-experimental-f0cc45f82 •
mjackson
published 0.0.0-nightly-428117233-20250418 •
mjackson
published 0.0.0-experimental-573acd4d4 •
mjackson
published 0.0.0-experimental-4cf800728 •
mjackson
published 7.5.1 •

Changelog

Source

v7.5.1

Date: 2025-04-17

Patch Changes

  • 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)

    • 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

Unstable Changes

āš ļø 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

2345
…
77