TanStackT
TanStack4mo ago
4 replies
rubber-blue

Loader data from pathless layout

Is it possible to access a route’s loader data from a parent pathless layout?
I need to render a common layout component which needs part of the data loaded by all the child routes loaders (I cannot split the fetch or repeat it in the layout route loader too).
I tried using the unbounded global “useLoaderData({strict: false})” but it always returns undefined.
My other way would be to use a global state manager but I’d like to try in a more idiomatic way first.
Was this page helpful?