Skip to content
This repository has been archived by the owner on Dec 6, 2021. It is now read-only.

How to navigate from a redux-action ? #1

Closed
taipa-ibl opened this issue Mar 28, 2017 · 2 comments
Closed

How to navigate from a redux-action ? #1

taipa-ibl opened this issue Mar 28, 2017 · 2 comments

Comments

@taipa-ibl
Copy link

I see you setup react-navigation with redux, but in your template, i don't know how to navigate in a redux-actions like react-native-router-flux ( just import a action and use it).
Thank you.

@daose
Copy link
Owner

daose commented Mar 28, 2017

You can import { NavigationActions } from 'react-navigation', and then if you have dispatch, you can do

dispatch(NavigationActions.navigate({ routeName: 'Route' });

So if you're in a saga

yield put(NavigationActions.navigate({ routeName: 'Route' }); // import put from redux-saga/effects

I updated sagas/login.js.

There's a lot more you can do with it as well, you can see the available actions at NavigationActions.js

@taipa-ibl
Copy link
Author

Thank you !

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

No branches or pull requests

2 participants