0
I’m creating a mobile application that uses as a basis react-native
. To make the transition between the screens and to have a better user experience, I am using the libraries react-navigation
and react-navigation-fluid-transitions
.
My application has a Splashscreen that has a series of animations and after finishing the user is directed to the Loginscreen or the Workspacescreen.
The screen of Splashscreen takes the time of the animations to check if there is any user in the persistence, if any sends to the Workspacescreen otherwise send to the Loginscreen.
My component that manages the transitions of the routes is 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 the user is on Loginscreen or in the Workspacescreen and press the back button the same is coming back to Splashscreen.
What I need to do to inhibit the user from returning to the Splashscreen in such situations?
has a more elegant way of doing this using the Switchnavigator of
react-navigation
– Davi Wesley