Migrate to unstable_useRouterState hook#244
Merged
Merged
Conversation
Replaces useLocation/useParams/useNavigation calls with the consolidated unstable_useRouterState hook from remix-run/react-router#15038. useMatches calls that read loaderData are left in place since the new hook's matches omit data fields. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
brophdawg11
commented
May 13, 2026
| } | ||
|
|
||
| return navigation; | ||
| return { isActive, isPending }; |
Contributor
Author
There was a problem hiding this comment.
This hook probably could use some reworking now
Contributor
There was a problem hiding this comment.
Whoa, this hook is kind of crazy. Yeah I imagine it can, I imagine it's original purpose is quite different from what's even needed now
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
brookslybrand
approved these changes
May 14, 2026
Contributor
brookslybrand
left a comment
There was a problem hiding this comment.
Sweet! Looks great. Pulled down and tested all the interactions this PR touched. Nice cleanup overall
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
unstable_useRouterStatehook from remix-run/react-router#15038, consolidatinguseLocation/useParams/useNavigationcalls into a single hook.useMatchescalls in app/hooks/use-doc.ts and app/modules/docsearch.tsx are intentionally left alone — the new hook'smatchesis typed asOmit<UIMatch, "data" | "loaderData">, and both call sites readloaderData.~/hooks/use-navigationwrapper now usesuseRouterStateinternally, sodocs-menu/menu.tsxandversion-select.tsxpick up the change transparently.Test plan
pnpm run typecheckpassespnpm run testpasses (31/31)<VersionSelect>popup<DetailsMenu>closes on navigation and on form submission🤖 Generated with Claude Code