Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why the selected value does not shown in drop down box?

Here is my code.

This is a form for filling in the request object attributes.

Expected Result

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Users can select a technician from the drop-down box, and then the selected technician information will be stored in the request object.

The problem

My problem is the selected value does not show in the drop-down box.

What I want

I want the drop-down box component to be self-contained.
So, should I store the selected technician object in the reducer object in Technician.js? However, I just want to store the selected technician object in the HelpDesk.js only.

I don’t know why the selected technician object is not updated to the Technician.js.

Would you give me some advice on this issue?

>Solution :

   <Select
    isClearable
    onChange={doChange}
    options={itemList.technicianList}
    placeholder="Please select a technician"
  />

It didn’t change because you were providing the select component with prop value. Just simply remove value and it will work fine or if you wanna give it a default value use defaultValue.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading