Last active
March 29, 2018 17:04
-
-
Save HERRKIN/25b6b621e9be97ee297c18c3f2016022 to your computer and use it in GitHub Desktop.
linkTo action for drawer links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function* linkTo({ payload }) { | |
const { route, params } = payload | |
const action = ['Products', 'Configuration', 'Profile'].includes(route) | |
? NavigationActions.reset({ | |
index: 0, | |
key: route, | |
actions: [NavigationActions.navigate({ routeName: route, params })], | |
}) | |
: NavigationActions.navigate({ routeName: route, params }) | |
yield put(action) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment