React uses value
instead of selected
for consistency across the form components. You can use defaultValue
to set an initial value. If you're controlling the value, you should set value
as well. If not, do not set value
and instead handle the onChange
event to react to user action.
Note that value
and defaultValue
should match the value
of the option.