TanStack / router

🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering.
https://tanstack.com/router
MIT License
7.19k stars 486 forks source link

`parentMatchPromise` is `undefined` in the loader of a child route #1540

Closed visualjerk closed 2 weeks ago

visualjerk commented 2 weeks ago

Describe the bug

Inside the loader of a child route parentMatchPromise is always undefined.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-rekhkq?file=src%2Froutes%2Fparent.child.tsx

Steps to Reproduce the Bug or Issue

  1. Click on "Child"
  2. Error expect parentMatchPromise to be defined is thrown

Expected behavior

As a developer, I expect parentMatchPromise to be defined in the loader of a child route, so I can await the loader of the parent route and act based on its result.

Screenshots or Videos

No response

Platform

Additional context

This feature is not documented yet and I found it in this discussion.