5

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

  • Question is similar to https://stackoverflow.com/questions/51187582/how-should-the-new-context-api-work-with-react-native-navigator – Simon B. Oct 15 '18 at 20:48

2 Answers2

0

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.

Simon B.
  • 2,013
  • 18
  • 28
0

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)

Manu Rauck
  • 168
  • 8