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

201
Views
How do I manage state in react with a master-detail component

I'm looking to build the following functionality in a site similar to below: https://au.indeed.com/jobs?q=no%20experience&l=Melbourne%20VIC&from=searchOnHP&vjk=6c88ada376b9317e

What I mean is, I would like to try and build two components. A list of cards on the left and an info pane on the right which populates with information when you click on the left card.

What is the correct way to manage this? Would you use state on the left component and pass it through the tree or use redux and send the state to represent the information?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

State is managed above the list, kind of like this:

const Container = ({things}) => {
    const [selected,setSelected] = useState()

    return (
       <>
          <ThingList things={things} onSelect={setSelected}/>
          <DetailView thing={selected}/>
       </>
    )

}
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!