Skip to content

Do I need a Provider? #384

Closed Answered by Aslemammad
imcvakt asked this question in Q&A
Mar 26, 2021 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

Do I need a provider?

Hmm, yes and no, we introduced provider-less mode a time ago. If you have a SSR app that needs to provide initial values for atoms on the server-side render phase, yes, you have to use Provider with initialValue prop in it. But if not, you don't need to use the Provider anymore. Or, for better debugging and seeing all values, we use the provider.

Can I have multiple providers?

Yes, why not? You can use more providers to provide different values for different subtrees.

What's the difference?

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@dai-shi
Comment options

@dai-shi
Comment options

@Aslemammad
Comment options

@imcvakt
Comment options

@dai-shi
Comment options

Answer selected by imcvakt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants