I have a dropdown with a couple of fields that are used for updating an entry in the db. However I have an issue when I click submit to have a dropdown go back to initial - default state.
Here is the dropdown
<select className="select--field" name="products" onChange={(e) => {handleChange(e)}}>
<option value={null}>Please select a product</option>
{data.products.map(({id, productName}) => (
<option key={id} value={id}>{productName}</option>
))}
</select>
What handleChange does is setting up selected product id as currently selected product so I can map through data and set placeholders as pre-filled data in fields below (not shown here).
I get the data via GraphQL useQuery, it might be that I am not controlling this field as I should so I can't really control it after an event like onSubmit. All suggestions are welcome, thnx.