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

215
Views
How to update dropdown list field based on another dropdown list in reactjs redux

I'm completely new to coding in reactjs and I'm using MERN stack and still trying to understand redux store. So basic functions I understand but let's say I have a country and city dropdown lists, how can I approach this using actions, reducers, and the component?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I would have the redux state look like this:

{
   countries: {
      "USA": ["New York", "Los Angeles", ...],
      "United Kingdom": ["London", "Manchester", ...],
   },
   selectedCountry: "USA"
}

Then you can have some code that extracts the list of cities based on the selectedCountry, and an action that changes the selectedCountry based on the onChange of a Select element.

over 4 years ago · Santiago Trujillo 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!