Packages

react-router

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

Your version

7.13.1

23 Feb 2026Where it was published

7.18.6 is the newest release of 7.x.

In short

1 new8 fixed

Security

12 advisories affect 7.13.1; 7.18.2 fixes them

7 more

Release note

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

Patch Changes

  • Fix null reference exception in bad codepath leading to invalid route tree comparisons

  • Clear timeout when turbo-stream encoding completes

  • Improve error message when Origin header is invalid

  • Fix matchPath optional params matching without a "/" separator.

    • matchPath("/users/:id?", "/usersblah") now returns null.

    • matchPath("/test_route/:part?", "/test_route_more") now returns null.

  • Add RSC unstable_getRequest

  • Fix HydrateFallback rendering during initial lazy route discovery with matching splat route

  • [UNSTABLE] Add support for <Link unstable_mask> in Data Mode which allows users to navigate to a URL in the router but "mask" the URL displayed in the browser. This is useful for contextual routing usages such as displaying an image in a model on top of a gallery, but displaying a browser URL directly to the image that can be shared and loaded without the contextual gallery in the background.

    // routes/gallery.tsx
    export function clientLoader({ request }: Route.LoaderArgs) {
      let sp = new URL(request.url).searchParams;
      return {
        images: getImages(),
        // When the router location has the image param, load the modal data
        modalImage: sp.has("image") ? getImage(sp.get("image")!) : null,
      };
    }
    
    export default function Gallery({ loaderData }: Route.ComponentProps) {
      return (
        <>
          <GalleryGrid>
            {loaderData.images.map((image) => (
              <Link
                key={image.id}
                {/* Navigate the router to /galley?image=N */}}
                to={`/gallery?image=${image.id}`}
                {/* But display /images/N in the URL bar */}}
                unstable_mask={`/images/${image.id}`}
              >
                <img src={image.url} alt={image.alt} />
              </Link>
            ))}
          </GalleryGrid>
    
          {/* When the modal data exists, display the modal */}
          {data.modalImage ? (
            <dialog open>
              <img src={data.modalImage.url} alt={data.modalImage.alt} />
            </dialog>
          ) : null}
        </>
      );
    }

    Notes:

    • The masked location, if present, will be available on useLocation().unstable_mask so you can detect whether you are currently masked or not.

    • Masked URLs only work for SPA use cases, and will be removed from history.state during SSR.

    • This provides a first-class API to mask URLs in Data Mode to achieve the same behavior you could do in Declarative Mode via manual backgroundLocation management.

  • RSC: Update failed origin checks to return a 400 status and appropriate UI instead of a generic 500

  • Preserve query parameters and hash on manifest version mismatch reload

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.