Recommend Placing Inside ApolloProvider?
When there are other providers, does it matter in which order they're placed? Here's the direction I went with my expo app, but I thought others might have this question as well, so maybe the docs should mention this point 🤔
<ApolloProvider client={client}>
{
<ThemeProvider>
<View style={styles.container}>
{Platform.OS === 'ios' && <StatusBar barStyle="default" />}
{Platform.OS === 'android' && <View style={styles.statusBarUnderlay} />}
<RootNavigation />
</View>
</ThemeProvider>
}
</ApolloProvider>
Hi @geirman. Good point!
It doesn't matter where you put our ThemeProvider because it only shares a context. But it could matter for other Providers and it depends on their implementation.
Do you know about some Provider (from Apollo, redux. etc.) that could not work well with ThemeProvider if not in correct order?
I'm not aware of any problems or conflicts, but the question occurred to me, so I assume it occurs to others as well. I know that it can sometimes matter with HOCs.
Hi @geirman - thanks for your input. I think that user should be aware of that when he uses other providers, but with that being said, you can always make a nice PR to the decumentation ;)