Route Context Undefined in Child Route on Reload
I have a parent route layout at
This error occurs when trying to access the organization data in the child route, even though it should be available according to the TS defintion.
Reproduction: https://github.com/thomasfqb12/tanstack-start-undefined-context
Am I misunderstanding the usage of route context and beforeLoad? If my context can be undefined, I would expect TypeScript to infer this.
/orgs/$slug that fetches the organization by slug and makes it available to the child route. In the child route /orgs/$slug/dashboard, the organization is inferred as an Organization (non-optional). However, upon reloading the page, I encounter the following error:Can't access property 'id', context.organization is undefined.This error occurs when trying to access the organization data in the child route, even though it should be available according to the TS defintion.
Reproduction: https://github.com/thomasfqb12/tanstack-start-undefined-context
Am I misunderstanding the usage of route context and beforeLoad? If my context can be undefined, I would expect TypeScript to infer this.