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

126
Vistas
What is more prefered way of updating data in child components hooks or redux?

i am new to JS. And I wondered what is more prefered way for updating data in children components. Is that better to use hooks or redux? Let say i have a parent component with 3 child components.

<Parent> 
  <ChildA/>
  <ChildB/>
  <ChildC/>
</Parent>

And i have a need to update something in ChildA and ChildB and pass it to ChildC

What would the best way to do it ?

Shall i use hooks like this?

[childAValue, setChildAValue] = useState([])
[childBValue, setChildBValue] = useState([])

  <ChildA onChildChanged={(e) => {
    setChildAValue(e)
    }}
  />
  <ChildB onChildChanged={(e) => {
    setChildBValue(e)
    }}
  />
  <ChildC childAValue={childAValue} setChildBValue={setChildBValue} />

Or it's better to use redux ? Because with using hooks i may have a lot of rerendering if there are 3-4 components or more. But on the other hand Redux will be just overloaded if i will use it for every possible component Which way do you prefer more and why? This question also refears to modals also when you need to pass value from modals to suibling component/s.

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

0

here you have multiple child components, you need to pass down functions to change them in all of them, redux can be used here and it will remove the hassle pass down props to each of the components. Redux is industry standard and is being used in large web projects, where you need to manage a global state to be present and accessible in all of the components/modules, for example Authentication state, for your question simply passing down as props also works so there is no need to complicate things further.

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