useLoaderData in export handle #2672
-
Trying to create breadcrumbs that can handle dynamic routes. I am able to use useParams() in the export handle but useLoaderData() returns undefined.
Any ideas if this can be done? |
Beta Was this translation helpful? Give feedback.
Answered by
sergiodxa
Apr 6, 2022
Replies: 1 comment 5 replies
-
How are you calling If you define that function in the route |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
machour
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How are you calling
breadcrumb
? Also where you callbreadcrumb
will affect what loader data do you get.If you define that function in the route
routes/parent/child.tsx
and you call it inroutes/parent.tsx
the loader data should be the one onroutes/parent.tsx
since that's where the "component" breadcrumb is rendered.