I'm creating a mobile app that uses react-native
as the basis. To make the transition between screens and to have a better user experience, I'm using react-navigation
libraries and react-navigation-fluid-transitions
.
My application has a custom SplashScreen that has a series of animations and, after finishing the user, is directed to LoginScreen or WorkspaceScreen .
The SplashScreen screen takes advantage of the animations' time to check if there are any users in persistence, if there is a move to the WorkspaceScreen otherwise it will call LoginScreen .
My component that manages the route transitions looks like this:
FluidNavigator ( ./navigation/FluidNavigator/index.js
)
import React from 'react'
import { FluidNavigator } from 'react-navigation-fluid-transitions'
import SplashScreen from '../../screens/SplashScreen'
import LoginScreen from '../../screens/LoginScreen'
import WorkspaceScreenfrom '../../screens/WorkspaceScreen'
// ... outras screen's aqui
export default Navigator = FluidNavigator({
SplashScreen: { screen: SplashScreen },
LoginScreen: { screen: LoginScreen, },
WorkspaceScreen: { screen: WorkspaceScreen},
// ... outras rotas aqui
});
My problem is that if you're on the LoginScreen or the WorkspaceScreen and press the back button it's back to SplashScreen .
What do I need to do to prevent the user from returning to the SplashScreen screen in these situations?