Uncontrolled select element
Renders an uncontrolled <select>
element that uses a callback function to pass its value to the parent component.
- Use the the
selectedValue
prop as thedefaultValue
of the<select>
element to set its initial value.. - Use the
onChange
event to fire theonValueChange
callback and send the new value to the parent. - Use
Array.prototype.map()
on thevalues
array to create an<option>
element for each passed value. - Each item in
values
must be a 2-element array, where the first element is thevalue
of the item and the second one is the displayed text for it.