using states in a react-navigation without redux

Multi tool use
Multi tool use


using states in a react-navigation without redux



as written in the react-navigation page:



Warning: in the next major version of React Navigation, to be released in Fall 2018, we will no longer provide any information about how to integrate with Redux and it may cease to work.



In the next version of react-navigation it could be hard to use redux with react-navigation.



My question is: what can I do to use states (and passing states between screens) in a react-navigation app without using redux?




2 Answers
2



For children of navigator



react-navigation gives you an withNavigation HOC, so you can easily wrap the component inside it to access the navigation state and navigate.


withNavigation



Why you integrate react navigation with redux?



For me, I want to be able to perform navigation actions from outside of my components(screens). Eg: Redux-saga. If we don't integrate, we can't navigate via redux-saga.



For a task like that we don't need to integrate react-navigation and redux. We just need to use NavigationService.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

U1 20GuMQwt,jWve9wWFry,Y5wr dGYoxMYzT sOU,0Gjs z3EMNkA7Bb,y 6P kRx2gb9VYxJS5D7E1yA,gA
5K 6BpVQbStKArbZOFxJjBDx4J3vZszm,w,1bYWMWMBr3yC,UqKbAH,NACGjDvFq SS25

Popular posts from this blog

PySpark - SparkContext: Error initializing SparkContext File does not exist

django NoReverseMatch Exception

List of Kim Possible characters