I am learning react and it's fun!
I am creating a sign up form in React using react-select.
I am mapping values from array:
const options = [ 'female', 'male', 'other']
<Select {...register("gender")}
label="Gender"
fullWidth
variant="outlined"
>
{options.map(value => (
<option key={value} value={value}>
{value}
</option>
))}
</Select>
But I get following warning:
Warning: Use the defaultValue or value props on instead of setting selected on .
Questions:
- How do I use the
defaultValueorvalueprops on ? - I am setting label="Gender" but it is not visible, why?
