TanStackT
TanStack12mo ago
2 replies
brilliant-lime

Equivalent to React Router `handle`?

Hi everyone,

I'm currently transitioning a project from RR to Tanstack Router and I haven't exactly found an equivalent for the route handle concept (https://reactrouter.com/start/framework/route-module#handle).

Baiscally, I need a way to return some component or value from a route and be able to retrieve it further up the tree using useMatches.

I thought context should help (as I can see the output of useMatches has a context object) but I can't figure out how to pass a value from within a root. Any thoughts?
Was this page helpful?