Packages

react-router

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

Upgrading react-router From 6.20.0 to 7.18.2

80 releases in betweennotes for 74

Reading releases, release notes and advisories…

Other targets from 6.20.0Newest 6.x6.30.6Clears its 4 advisories7.18.0Latest8.5.1
  1. 6.20.0yours
  2. 26 releases
  3. 6.30.3security
  4. 3 releases
  5. 7.0.0major
  6. 35 releases
  7. 7.12.0security
  8. 12 releases
  9. 7.18.2target
39+
changes to make
4
advisories fixed
61+
new
217+
fixes

Counted from 74 of 80 release notes. Advisories are counted from the advisory database, in full.

Before you upgrade

Tick each one off as you go
  • Breaking7.15.0
  • Breaking7.15.0
  • Breaking7.14.0
  • Breaking7.10.0
  • Breaking7.9.6
  • Breaking7.8.0
  • Breaking7.8.0
  • Breaking7.8.0
  • Breaking7.5.0
  • Breaking7.4.1

Security

  • react-router - Harden RSC CSRF codepaths.

    7.18.2
  • Add additional layer of CSRF protection by rejecting submissions to UI routes from external origins. If you need to permit access to specific external origins, you can specify them in the react-router.config.ts config allowedActionOrigins field.

    7.12.0
  • 6.30.3

Release by release

  1. 7.18.2

    Security fix28 Jul 2026
    • Security

      react-router - Harden RSC CSRF codepaths.

  2. 7.18.1

    29 Jun 20261 fix
    • Fixed

      react-router-dom - Fix incorrect package.json main field for CommonJS builds

  3. 7.18.0

    16 Jun 20268 fixes
    • Fixed

      Fix server handler prerender responses when using ssr: false and future.v8_trailingSlashAwareDataRequests: true. Avoids false positive "SPA Mode" detection when serving prerendered paths

    • Fixed

      Use the ServerRouter nonce for nonce-aware SSR components when they don't provide their own value so strict CSP pages can load them.

    • Fixed

      Use turbo-stream to serialize and deserialize Framework Mode hydration errors

    • Fixed

      Precompute route branch matchers to avoid recompiling route path regexes during matching

  4. 7.17.0

    4 Jun 20261 new
    • New

      Ship a subset of the official documentation inside the react-router package

  5. 7.16.0

    28 May 20261 new · 4 fixes
    • New

      Stabilize future.unstable_trailingSlashAwareDataRequests as future.v8_trailingSlashAwareDataRequests

    • Fixed

      Disable manifest path when lazy route dicovery is disabled

    • Fixed

      Fix browser URL creation to use the configured history window instead of the global window.

    • Fixed

      Fix useNavigation() return type to preserve discriminated union across navigation states

    • Fixed

      Widen MetaDescriptor script:ld+json type from LdJsonObject to LdJsonObject | LdJsonObject to permit multiple JSON-LD schemas in a single <script type="application/ld+json"> tag emitted by <Meta />

  6. 7.15.1

    14 May 20261 new · 5 fixes
    • New

      Add a new unstable_useRouterState() hook that consolidates access to active and pending router states (RFC: #12358)

    • Fixed

      Update router to operate on fetcher Maps in an immutable manner to avoid delayed React renders from potentially reading an updated but not yet committed Map. This could result in brief flickers in some fetcher-driven optimistic UI scenarios.

    • Fixed

      Fix serverLoader() returning stale SSR data when a client navigation aborts pending hydration before the hydration clientLoader resolves

    • Fixed

      Fix RouterProvider onError callback not being called for synchronous initial loader errors in SPA mode

    • Fixed

      Memoize useFetchers to return a stable identity and only change if fetchers changed

    • Fixed

      Internal refactor to consolidate mutation request detection through shared utility

  7. 7.15.0

    Migration needed5 May 20267 new · 4 fixes
    • Breaking

      ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly

    • Breaking

      Remove unstable_subResourceIntegrity from the runtime FutureConfig type; the flag is now controlled by the top-level subResourceIntegrity option in react-router.config.ts

    • New

      Stabilize unstable_defaultShouldRevalidate as defaultShouldRevalidate on <Link>, <Form>, useLinkClickHandler, useSubmit, fetcher.submit, and setSearchParams

    • New

      Stabilize the instrumentation APIs. unstable_instrumentations is now instrumentations and unstable_pattern is now pattern

  8. 7.14.2

    21 Apr 20261 fix
    • Fixed

      Remove the un-documented custom error serialization logic from the internal turbo-stream implementation. React Router only automatically handles serialization of Error and it's standard subtypes (SyntaxError, TypeError, etc.). ([aabf4a1)

22 other lines we could not sort, mostly version bumps
  • The match.shouldLoad API is now marked deprecated in favor of these more powerful alternatives

    7.10.0
  • If you're using this API in a custom dataStrategy today, you can swap to the new API at your convenience:

    7.10.0
  • match.shouldRevalidateArgs is the argument that will be passed to the route shouldRevaliate function

    7.10.0
  • Combined with the parameter accepted by match.shouldCallHandler, you can define a custom revalidation behavior for your dataStrategy:

    7.10.0
  • A parent route has only a loader (does not have a clientLoader)

    7.2.0
  • The parent route is pre-rendered

    7.2.0
  • The parent route has children routes which are not prerendered

    7.2.0
  • This means that when the child paths are loaded via the SPA fallback, the parent won't have any loaderData because there is no server on which to run the loader

    7.2.0
  • This can be resolved by either adding a parent clientLoader or pre-rendering the child paths

    7.2.0
  • If you add a clientLoader, calling the serverLoader() on non-prerendered paths will throw a 404

    7.2.0

29 internal lines (docs, tests, tooling) left out.

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.