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

174
Views
Changing select options based on state

Hey I am trying to change options of select input in form based on previous select input but somehow this select does not render...any idea? Might that be because it cannot be rendered immedeatly or do I have my syntax wrong. The options here (other than "Choose district") just dont get rendered

      <Form.Select
            style={{ border: error ? "2px solid red" : "" }}
            onChange={handleFormData("district")}
          >
            {" "}
            <option>Choose district</option>
            {regions.map((region) => {
              if (region.region === districts) {
                console.log(districts);
                region.districts.split(",").map((district) => {
                  return <option value={district}>{district}</option>;
                  
                });
                console.log(region.districts.split(","));
              }
            })}
          </Form.Select>

This is the array that gets printed in the last console log

[ "Benešov", " Beroun", " Kladno", " Kolín", " Kutná Hora", " Mělník", " Mladá Boleslav", " Nymburk", " Praha-východ", " Praha-západ", " Příbram a Rakovník" ]

about 4 years ago · Juan Pablo Isaza
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!