How to dispatch multiple actions in react-navigati

2020-02-13 01:29发布

I want to perform two actions but it doesn't work.

const backAction = NavigationActions.back({
    key: null
})
const dispatchLogoutAction = NavigationActions.reset({
    index: 0,
    actions: [NavigationActions.navigate({routeName: "LoginView"})]
});
nextProps.navigation.dispatch(backAction);
nextProps.navigation.dispatch(dispatchLogoutAction);

What other ways to dispatch both actions in react-navigation rather than listing dispatch statements parallelly?

0条回答
登录 后发表回答