Firebase注销后弹出堆栈时反应导航错误

时间:2020-10-15 21:15:31

标签: reactjs firebase react-native react-navigation

我在我的本机应用程序中使用反应导航进行导航。运行firebase.auth().signOut后,该应用程序自登录以来就已正常退出。我使用了popToTop StackAction及其日志记录The action 'POP_TO_TOP' was not handled by any navigator 下面是代码:

async function logOut() {
   try {
    await firebase.auth().signOut();
    navigation.dispatch(
      StackActions.popToTop()
    );

   } catch (error) {
     console.log(error)
   }
  }
     <Button title="Sign Out"  onPress ={() => logOut()}/>

0 个答案:

没有答案