Replies: 1 comment 1 reply
-
I recommend creating a custom hook that you export from root // root.tsx
export function useRootLoaderData() {
return useLoaderData<typeof loader>()
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If I’m not mistaken, the
root
route loader data is always available, because this route encapsulates all other routes.It would be nice if
useRouteLoaderData
would be overloaded and would returnSerializeFrom<typeof rootLoader>
if its argument is"root"
, andSerializeFrom<typeof rootLoader> | undefined
(as it currently does) otherwise.Beta Was this translation helpful? Give feedback.
All reactions