Warning: Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>. code example

Example: Use the `defaultValue` or `value` props on instead of setting `selected` on . whatever by Brainy Beetle on Apr 20 2021 Donate Comment 0 Source: stackoverflow.com

<select defaultValue={'DEFAULT'} >
        <option value="DEFAULT" disabled>Choose a salutation ...</option>
        <option value="1">Mr</option>
        <option value="2">Mrs</option>
        <option value="3">Ms</option>
        <option value="4">Miss</option>
        <option value="5">Dr</option>
      </select>

Tags:

Misc Example