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

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.

Leave a Reply