[Bug?]: v7 useMatches not working as expected in route module #12428
Unanswered
discoverlance-com
asked this question in
Q&A
Replies: 1 comment
-
I also tried this in filebased routing and it's the same result, I am only seeing the handle function from the current page I have visited. The handle from all previous pages (in the nested route) does not show. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am not sure if this issue also persists when using the file system routing convention but I noticed it whilst using the Route Configuration convention.
This is my routes as defined below whilst using routes config.
I have added
handle
function to the three pages in my app layout,./routes/dashboard/route.tsx
(/app),./routes/dashboard/account/route.tsx
(/app/account) and/routes/dashboard/account/password/route.tsx
(/app/account/password).I am trying to add breadcrumbs to my pages so for each of the handle functions in the 3 pages, I have added some breadcrumb information. See the example below for the breadcrumb information for the route:
./routes/dashboard/account/route.tsx
(/app/account).But when I run
useMatches
either in the root or in theapp
route layout, all the matches return quite weird route ids corresponding to the layouts and the current page with each of them having anundefined
handle. So I only always get the information from the handle route function defined in the current page. See an example log of the matches fromuseMatches
in the browser below:Beta Was this translation helpful? Give feedback.
All reactions