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

130
Vistas
Is there any better solution then passing prop up to the parent component?

I am in situation that I need to use state from one component as a dependency value in another's componet useEffect hook. Easy illustration of this situation is in attached image.

enter image description here

I know that I can pass state from first component up to the parent component, in this case the App component, and then the state from parent component (App) pass down to the second component as a prop. But is there any better solution?

Thank you for your help.

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

0

you could either lift the state up to the parent component using a func for example and pass it down to component2, or use a state management library, depending on the scale of your app, smaller - medium scale I would use React context-API or redux since its widely used and easy to master

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