Skip to content

React Router integration matches far more routes than the router on every navigation #25340

Open

Description

@JoshuaKGoldberg

The React Router integration passes allRoutes (every nested route alongside its ancestors) to matchRoutes, which flattens each entry's children again, and then calls matchRoutes several times per navigation. On sentry.io's route tree this costs ~50ms per navigation (including query-only changes). It can also name a navigation after a nested route matched on its own instead of the route the router actually renders.

Fix: #25336

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions