TanStackT
TanStack2y ago
3 replies
awake-maroon

useRouteContext initially undefined

Hi,

I have a custom ssr project.

I'm using the useRouterContext in my react component and observing the following.

1. When rendered on server its defined.
2. When client side navigating to the page with the component, its defined.
3. When loading the page, i see that the initial correct html, but instantly get on error in browser due to context being undefined.

I do not have any hydration warnings or errors.

I remember back in the days when working with react router that I had to wait for it to be initialized or something.

Anyone has an idea of what might be wrong?
Was this page helpful?