Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!