Skip to content

ref: Convert from useRoutes() to useMatches() in areas related to getRouteStringFromRoutes()#112265

Open
ryan953 wants to merge 10 commits intomasterfrom
ryan953/ref-getRouteStringFromRoutes
Open

ref: Convert from useRoutes() to useMatches() in areas related to getRouteStringFromRoutes()#112265
ryan953 wants to merge 10 commits intomasterfrom
ryan953/ref-getRouteStringFromRoutes

Conversation

@ryan953
Copy link
Copy Markdown
Member

@ryan953 ryan953 commented Apr 6, 2026

This removes almost all the useRoutes() calls related to getRouteStringFromRoutes().

There's still a few more related to breadcrumbs, and a class-based <DateRange> component :(

All the changes were very mechanical:

  • We're swapping routes for matches most of the time.
  • getRouteStringFromRoutes has a new parallel impl for matches, test was updated to match and i validated it in-app too
  • useRouteActivatedHook() accepts more props than it uses. I even added a new prop to the list, because react was complaining that the hook was not being called from within a Context parent. I guess our hooks system loses React Context links between the top of the tree and lower down. The specific type is vendored, so i left it alone.

Related to https://github.com/getsentry/frontend-tsc/issues/78

@ryan953 ryan953 requested review from a team as code owners April 6, 2026 16:39
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 6, 2026
@ryan953 ryan953 changed the title Ryan953/ref get route string from routes ref: Convert from useRoutes() to useMatches() in areas related to getRouteStringFromRoutes() Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant