Closed yuvrajchaudhari03 closed 1 year ago
I have used LottieSplashScreen.hide() but when I switch off internet and open the app it continuously running
LottieSplashScreen.hide()
function Root() { const [isTryingLogin, setIsTryingLogin] = React.useState(true); const authCtx = React.useContext(AuthContext); React.useEffect(() => { if (isTryingLogin === false) { LottieSplashScreen.hide(); // here } }, [isTryingLogin]); React.useEffect(() => { async function fetchToken() { const storedToken = await AsyncStorage.getItem("token"); if (storedToken) { authCtx.authenticate(storedToken); } setIsTryingLogin(false); } fetchToken(); }, []); if (isTryingLogin) { return <Loader />; } return <Navigation />; }
@HwangTaehyun
Ah.. I think that is not related to the network. It seems to be a problem with authCtx.authenticate though.
I will close this issue!
I have used
LottieSplashScreen.hide()
but when I switch off internet and open the app it continuously running@HwangTaehyun