T
TanStack9mo ago
adverse-sapphire

Providers?

So for tanstack router all providers are in the context? So no wrapping like in react router or NextJS?
4 Replies
foreign-sapphire
foreign-sapphire9mo ago
no. while you can put things into router context you can also wrap in providers
adverse-sapphire
adverse-sapphireOP9mo ago
which is better? Id prefer to do things the tanstack way
rare-sapphire
rare-sapphire9mo ago
It dependent how you want to update it. With React context you can update it anywhere in the app and consumers will rerender. In order to change router context a navigation or a router invalidation needs to happen
stormy-gold
stormy-gold9mo ago
Also, depends on need, at least as far as I know, you cannot read a react context inside of loaders.

Did you find this page helpful?