Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

React Native Random Inner screen flashes for sec before splash screen in iOS

$
0
0

I have created a switch navigator between the auth and app screens. The first time it worked fine but after when we use the app for some time it shows a random screen before splash when we open the application again. On Android, it works fine.

Here's my code for app navigator:

// Authentication Screens Stack
const AuthStack = createStackNavigator(
    {
        LoginScreen: LoginScreen,
        // Login With Instagram Screen
        LoginInstagram: LoginInstagramScreen,
        RegisterScreen: RegisterScreen,
        ForgotPasswordScreen: ForgotPasswordScreen
},
    {
        // See https://reactnavigation.org/docs/en/stack-navigator.html#stacknavigatorconfig
        headerMode: 'none',
}
);
// Main App Stack from Home Screens
const AppStack = createStackNavigator(
    {
        DrawerScreen: DrawerNavigator,
},
    {
        // See https://reactnavigation.org/docs/en/stack-navigator.html#stacknavigatorconfig
        headerMode: 'none',
}
);
// Switch Navigator Between Authentication and Home Screens
const SwitchStack = createSwitchNavigator(
    {
        Auth: AuthStack,
        App: AppStack,
},
    {
        // See https://reactnavigation.org/docs/en/stack-navigator.html#stacknavigatorconfig
        headerMode: 'none',
}
);

export default createAppContainer(SwitchStack)

Here's code for app.js

render() {
return (
/**
 * @see https://github.com/reduxjs/react-redux/blob/master/docs/api/Provider.md
 */
<Provider store={store}>
{/**
 * PersistGate delays the rendering of the app's UI until the persisted state has been retrieved
 * and saved to redux.
 * The `loading` prop can be `null` or any react instance to show during loading (e.g. a splash screen),
 * for example `loading={<SplashScreen />}`.
 * @see https://github.com/rt2zz/redux-persist/blob/master/docs/PersistGate.md
 */}
<PersistGate loading={<SplashScreen />} onBeforeLift={this.onBeforeLift} persistor={persistor}>
{this.state.gateLifted ? <RootScreen LoginStatus={this.state.isLogin} /> : <SplashScreen />}
{/* {<RootScreen LoginStatus={this.state.isLogin} />} */}
</PersistGate>
</Provider>
)
}

I have seen many apps showing this type of behaviour but not found anything about it. Any help would be appreciated. Thanks in advance


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>