首页 > 解决方案 > 注销时重新启动expo应用程序而不弹出

问题描述

当我单击注销功能时,我想重新加载整个 expo 应用程序,并且我想在不弹出应用程序的情况下执行此操作,是否有解决方法?任何帮助,将不胜感激。我研究了 react-native-restart 库,但它需要我弹出我的应用程序。

这些是我当前的代码

  logOut() {
    Auth.currentAuthenticatedUser({
      bypassCache: false  
    }).
      then(
        user => user.signOut()
      )
      .catch(err => console.log(err))
  }

标签: authenticationexpo

解决方案


您可以使用

import { Updates } from 'expo';
Updates.reload()

通常用于在有新更新时重新加载应用程序,但也应该适用于您的情况


推荐阅读