5
votes

has anybody being able to use the new Context API introduce in react 16.3 with react-native-navigation?

I'm having trouble trying to set it up as with react-native-navigation there is no main component where i can manage a state and then render the Context.Provider components, just the Navigation.startSingleScreenApp or similar functions.

Tks in advance for any help you can provide

Environment React Native Navigation version: 1.1.403 React Native version: 0.55.4 Platform(s): iOS Device info : Simulator

2

2 Answers

0
votes

Please update your question with the simplest code example that shows your problem.

Generally, you can wrap your for example outside or inside whatever is your .

Maybe see this guide https://medium.com/@505aaron/a-practical-react-native-problem-solved-with-the-context-api-eecaf2e05202 for a simple enough example that does create a custom Context Provider/Consumer pair that also has its own state.

0
votes

react-native-navigation with Context API is not possible. there are some workarounds (https://github.com/wix/react-native-navigation/issues/3549#issuecomment-411800487) but it is not the real React Context API behavior. (https://github.com/wix/react-native-navigation/issues/3549#issuecomment-427603125)