react-native-ios-kit icon indicating copy to clipboard operation
react-native-ios-kit copied to clipboard

Recommend Placing Inside ApolloProvider?

Open geirman opened this issue 8 years ago • 3 comments

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>

geirman avatar Jan 25 '18 16:01 geirman

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?

souhe avatar Jan 26 '18 07:01 souhe

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.

geirman avatar Jan 26 '18 08:01 geirman

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 ;)

adamTrz avatar Jan 26 '18 11:01 adamTrz