I have the select box, wrapped in a customized component. The values bind correctly, and I can select them fine. But when I add the onChange event, which triggers just fine and the localStorage does get set, no value is selected in the drop down list. What am I missing here?
const [selectedDrug, setSelectedDrug] = useState('');
const handleChange = event => {
localStorage.setItem("drugName", event.target.value);
setSelectedDrug(event.target.value);
};
<div className="provider-and-site-selector-container">
<SRFormFieldSelectProductName
name={resolveFullName("productName")}
label={"Product Name*"}
value={selectedDrug}
onChange={handleChange}
validate={Validators.required}
/>
</div>