-
-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useRouteContext typing does not include context from beforeLoad
#901
Comments
You need to use const { session } = useRouteContext({ from: '/' as const }); see https://stackblitz.com/edit/github-73nmhk-cs1a8c?file=src%2Fmain.tsx alternative: const { session } = useRouteContext({ from: indexRoute.id }); https://stackblitz.com/edit/github-73nmhk-q45wa2?file=src%2Fmain.tsx |
@schiller-manuel Using the breadcrumbs example from the docs, how would you solve this issue there when retrieving |
do you have a complete example on e.g. stackblitz? |
@schiller-manuel context is not typed at the RootRoute beforeload, only their children. |
I'll close this as the original issue is resolved. Please feel free to open new issues for further discussion. |
Describe the bug
Dashboard.tsx does not properly type the
session
frombeforeLoad
even though it is present in the route context.Your Example Website or App
https://stackblitz.com/edit/github-73nmhk?file=src%2Fmain.tsx
Steps to Reproduce the Bug or Issue
See bug description
Expected behavior
useRouteContext
should include the types frombeforeLoad
Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: