Skip to content

useRouteContext initially undefined #1635

@InsideGH

Description

@InsideGH

Describe the bug

When loading the page, 'useRouteContext' is undefined.
When client side navigating to the page, it's defined.

Your Example Website or App

https://tanstack.com/router/latest/docs/framework/react/examples/basic-ssr-file-based

Steps to Reproduce the Bug or Issue

It's can be reproduced in the "basic-ssr-file-based" example. If you go from "home" to "post" in browser, the context is defined. If you reload the page while standing on "post" page, it's undefined.

Screenshot from 2024-05-19 17-12-17

Expected behavior

useRouteContext being defined both during SSR load and Client side routing.

Screenshots or Videos

No response

Platform

Linux

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingssrEverything around SSR the story

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions