Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

124
Vistas
React Native navigation fade transition with ternary

I have the following code to create a simple splash screen using a ternary based on a piece of state called isLoading.

import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

const Stack = createNativeStackNavigator();

export default function App() {
    return (
        <NavigationContainer>
            <Stack.Navigator>
                {state.isLoading ? (
                    <Stack.Screen name="Splash" component={SplashScreen} />
                ) : (
                    <Stack.Screen name="App" component={App} />
                )}
            </Stack.Navigator>
        </NavigationContainer>
    )
}

I want to create a transition that will fade the splash screen into the app view, because the default is a slide animation. I've seen this stack overflow post, but it doesn't work in my case since I'm not actually navigating between screens, rather I'm replacing them.

I also want to keep using this ternary style because it's "protected routes" for a sign in system.

I've gotten close with the animationTypeForReplace option for a Screen, but it seems like it can only be 'push' or 'pop', not some sort of fade or no transition.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda