Modifying the Router Context with data from loader #895
Replies: 3 comments 6 replies
-
I'd be interested in this, too (for context, see #901 (comment)). Coming from |
Beta Was this translation helpful? Give feedback.
-
I think in practice the problem might get a little bit more complex. Not sure, if I'm wrong here with my route design, but consider this example:
Now, if a user would visit |
Beta Was this translation helpful? Give feedback.
-
https://tanstack.com/router/latest/docs/framework/react/guide/router-context mentions using the route contexts for the page title, but since you apparently can't alter the context from the loader, if the title comes from the loaded data, you won't be able to use a route context for it. Seems like a pretty big oversight for that use case. |
Beta Was this translation helpful? Give feedback.
-
Hi all,
is it somehow possible to add information to a Router Context from data fetched in a
loader
?For example to build a breadcrumb trail from the contexts (as in the example), it would be helpful to have informations from the fetched data. It could be useful to use the title of a blog post that was received in the
loader
, so that the title of the post can be added to the breadcrumb trail).Thanks,
Nils
Beta Was this translation helpful? Give feedback.
All reactions