How do I access parent's loader data from a child route ? #1015
Unanswered
manu-remsense
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey guys,
I decided to use the root route's loader function to fetch data from the backend, since I need this data throughout the app.
Some of the child routes need that data for route validation, instead of fetching it again on every route, I would like to re-use the loader data from the root route, and use it in the child route to validate against the path parameter (checking whether the id exists within the loaded data - if this id is not contained within the loader data then render an error component).
I haven't found any information on this so far, any help would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions