我想知道如何在 React Native 中触发导航操作(使用 react-navigation-redux-helpers(?
我厌倦了使用NavigationActions.navigate({ routeName: 'App' }(功能,但没有:(
react-navigation
为您提供动作创建者,请参阅 https://reactnavigation.org/docs/en/navigation-actions.html
import { NavigationActions } from 'react-navigation';
const navigateAction = NavigationActions.navigate({
routeName: 'Profile',
params: {},
action: NavigationActions.navigate({ routeName: 'SubProfileRoute' }),
});
this.props.navigation.dispatch(navigateAction);
尝试:
this.props.navigation.navigate('ScreenName')