Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with redux guide? #52

Closed
aksonov opened this issue Mar 14, 2016 · 4 comments
Closed

Integration with redux guide? #52

aksonov opened this issue Mar 14, 2016 · 4 comments

Comments

@aksonov
Copy link

aksonov commented Mar 14, 2016

It is not clear (from docs) how to share state between redux & navigation. I could combine all existing redux reducers with navigation reducers but how to use common state?

@aksonov
Copy link
Author

aksonov commented Mar 14, 2016

For now i see that props.navigateTo is 'alternative' of Redux props.dispatch() Could they be used together or i have to migrate from Redux to Navigation API?

@ericvicenti
Copy link
Owner

You shouldn't share state between NavigationRootContainer and redux, they should be held together.

If you use redux, use props.dispatch. If you store your state in NavigationRootContainer, use onNavigate.

@alexprice1
Copy link

@ericvicenti Would you suggest just using NavigationAnimatedView or NavigationCardStack without NavigationRootContainer? If so, would we have to reimplement the benefits of NavigationRootContainer?

Benefits:

  1. Can save state to disk to persist navigation state over refreshes or app updates
  2. Listens to Linking for url opening, and BackAndroid for easy back button support

@alexprice1
Copy link

Sorry, ignore my comment. Finally found a pretty good guide.

Here it is if anyone else is looking:

https://github.com/jlyman/RN-NavigationExperimental-Redux-Example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants