Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Sep 19, 2025

This PR contains the following updates:

Package Change Age Confidence
react-router (source) 7.9.3 -> 7.9.5 age confidence

Release Notes

remix-run/react-router (react-router)

v7.9.5

Compare Source

Patch Changes
  • Move RSCHydratedRouter and utils to /dom export. (#​14457)

  • useRoute: return type-safe handle (#​14462)

    For example:

    // app/routes/admin.tsx
    const handle = { hello: "world" };
    // app/routes/some-other-route.tsx
    export default function Component() {
      const admin = useRoute("routes/admin");
      if (!admin) throw new Error("Not nested within 'routes/admin'");
      console.log(admin.handle);
      //                ^? { hello: string }
    }
  • Ensure action handlers run for routes with middleware even if no loader is present (#​14443)

  • Add unstable_instrumentations API to allow users to add observablity to their apps by instrumenting route loaders, actions, middlewares, lazy, as well as server-side request handlers and client side navigations/fetches (#​14412)

    • Framework Mode:
      • entry.server.tsx: export const unstable_instrumentations = [...]
      • entry.client.tsx: <HydratedRouter unstable_instrumentations={[...]} />
    • Data Mode
      • createBrowserRouter(routes, { unstable_instrumentations: [...] })

    This also adds a new unstable_pattern parameter to loaders/actions/middleware which contains the un-interpolated route pattern (i.e., /blog/:slug) which is useful for aggregating performance metrics by route

v7.9.4

Compare Source

Patch Changes
  • handle external redirects in from server actions (#​14400)

  • New (unstable) useRoute hook for accessing data from specific routes (#​14407)

    For example, let's say you have an admin route somewhere in your app and you want any child routes of admin to all have access to the loaderData and actionData from admin.

    // app/routes/admin.tsx
    import { Outlet } from "react-router";
    
    export const loader = () => ({ message: "Hello, loader!" });
    
    export const action = () => ({ count: 1 });
    
    export default function Component() {
      return (
        <div>
          {/* ... */}
          <Outlet />
          {/* ... */}
        </div>
      );
    }

    You might even want to create a reusable widget that all of the routes nested under admin could use:

    import { unstable_useRoute as useRoute } from "react-router";
    
    export function AdminWidget() {
      // How to get `message` and `count` from `admin` route?
    }

    In framework mode, useRoute knows all your app's routes and gives you TS errors when invalid route IDs are passed in:

    export function AdminWidget() {
      const admin = useRoute("routes/dmin");
      //                      ^^^^^^^^^^^
    }

    useRoute returns undefined if the route is not part of the current page:

    export function AdminWidget() {
      const admin = useRoute("routes/admin");
      if (!admin) {
        throw new Error(`AdminWidget used outside of "routes/admin"`);
      }
    }

    Note: the root route is the exception since it is guaranteed to be part of the current page.
    As a result, useRoute never returns undefined for root.

    loaderData and actionData are marked as optional since they could be accessed before the action is triggered or after the loader threw an error:

    export function AdminWidget() {
      const admin = useRoute("routes/admin");
      if (!admin) {
        throw new Error(`AdminWidget used outside of "routes/admin"`);
      }
      const { loaderData, actionData } = admin;
      console.log(loaderData);
      //          ^? { message: string } | undefined
      console.log(actionData);
      //          ^? { count: number } | undefined
    }

    If instead of a specific route, you wanted access to the current route's loaderData and actionData, you can call useRoute without arguments:

    export function AdminWidget() {
      const currentRoute = useRoute();
      currentRoute.loaderData;
      currentRoute.actionData;
    }

    This usage is equivalent to calling useLoaderData and useActionData, but consolidates all route data access into one hook: useRoute.

    Note: when calling useRoute() (without a route ID), TS has no way to know which route is the current route.
    As a result, loaderData and actionData are typed as unknown.
    If you want more type-safety, you can either narrow the type yourself with something like zod or you can refactor your app to pass down typed props to your AdminWidget:

    export function AdminWidget({
      message,
      count,
    }: {
      message: string;
      count: number;
    }) {
      /* ... */
    }

Configuration

📅 Schedule: Branch creation - "after 7am and before 9am" in timezone Europe/Istanbul, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot requested a review from a team as a code owner September 19, 2025 05:46
@changeset-bot
Copy link

changeset-bot bot commented Sep 19, 2025

⚠️ No Changeset found

Latest commit: d19f070

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@renovate renovate bot force-pushed the renovate/react-router-monorepo branch from 0bd57bd to c37f8a8 Compare September 24, 2025 18:21
@renovate renovate bot changed the title fix(deps): update dependency react-router to v7.9.1 fix(deps): update dependency react-router to v7.9.2 Sep 24, 2025
@renovate renovate bot force-pushed the renovate/react-router-monorepo branch from c37f8a8 to 60c4ab7 Compare September 26, 2025 22:31
@renovate renovate bot changed the title fix(deps): update dependency react-router to v7.9.2 fix(deps): update dependency react-router to v7.9.3 Sep 26, 2025
@renovate renovate bot changed the title fix(deps): update dependency react-router to v7.9.3 fix(deps): update dependency react-router to v7.9.3 - autoclosed Oct 3, 2025
@renovate renovate bot closed this Oct 3, 2025
@renovate renovate bot deleted the renovate/react-router-monorepo branch October 3, 2025 13:11
@renovate renovate bot changed the title fix(deps): update dependency react-router to v7.9.3 - autoclosed fix(deps): update dependency react-router to v7.9.3 Oct 9, 2025
@renovate renovate bot reopened this Oct 9, 2025
@renovate renovate bot force-pushed the renovate/react-router-monorepo branch from ddabcdd to 60c4ab7 Compare October 9, 2025 04:41
@renovate renovate bot changed the title fix(deps): update dependency react-router to v7.9.3 fix(deps): update dependency react-router to v7.9.4 Oct 9, 2025
@renovate renovate bot force-pushed the renovate/react-router-monorepo branch from 60c4ab7 to 33ce77a Compare October 9, 2025 10:30
@renovate renovate bot force-pushed the renovate/react-router-monorepo branch from 33ce77a to d19f070 Compare October 29, 2025 22:55
@renovate renovate bot changed the title fix(deps): update dependency react-router to v7.9.4 fix(deps): update dependency react-router to v7.9.5 Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant