React Navigation (v4) sequential navigator
import React from 'react'; | |
import { withMappedNavigationProps } from 'react-navigation-props-mapper'; | |
import { createSequentialNavigator } from './createSequentialNavigator'; | |
import { ReviewRating, ReviewText } from './screens/review'; | |
const ReviewStack = createSequentialNavigator( | |
{ | |
ReviewRating: { | |
screen: withMappedNavigationProps()(ReviewRating), | |
}, | |
ReviewText: { | |
screen: withMappedNavigationProps()(ReviewText), | |
}, | |
}, | |
{ | |
initialRouteName: 'ReviewRating', | |
defaultNavigationOptions: { | |
title: "Submit Your Review", | |
}, | |
sequentialNavigationOptions: { | |
order: navigation => { | |
if (navigation.getParam('onlyRaring')) { | |
return ['ReviewRating']; | |
} | |
return [ | |
'ReviewRating', | |
'ReviewText', | |
]; | |
}, | |
}, | |
}, | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment