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

85
Vistas
Avoid repeating params in stack navigation

I am building the auth part of the stack navigation for a react navigation app, and ended with something like thiss:

 <Stack.Screen
        name="a"
        component={a}
        initialParams={{ url }}
      />
      <Stack.Screen name="f" component={f} />
      <Stack.Screen
        name="b"
        component={b}
        initialParams={{ url }}
      />
      <Stack.Screen
        name="c"
        component={c}
        initialParams={{ url }}
      />
      <Stack.Screen
        name="d"
        component={d}
        initialParams={{ url }}
      />

Is there any way I can avoid adding the url initialParams everywhere and add it maybe to the stack group screen around?

I tried to add it in the screenOptions prop in the stack group around, but didn't work.

Do you guys have any suggestion?

Thanks!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can create an object and use spread operator on components.

 const initialParams = { initialParams: { url } };


 <Stack.Screen
        name="a"
        component={a}
        {...initialParams}
      />

about 4 years ago · Juan Pablo Isaza Denunciar
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