T
TanStack6mo ago
metropolitan-bronze

Providers?

So for tanstack router all providers are in the context? So no wrapping like in react router or NextJS?
4 Replies
afraid-scarlet
afraid-scarlet6mo ago
no. while you can put things into router context you can also wrap in providers
metropolitan-bronze
metropolitan-bronzeOP6mo ago
which is better? Id prefer to do things the tanstack way
other-emerald
other-emerald6mo 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
sensitive-blue
sensitive-blue6mo 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?