I'm creating a new form with React and one of the inputs is a Material UI input. The form works great, but the console shows a Missing name at warning when the form loads even though I've put a name both on the select input and the hidden input that Material UI creates.
<FormControl variant="filled" className={classes.formControl} style={{ width: '100%' }}>
<InputLabel id="dog-breed-label">Dog Breed</InputLabel>
<Select
label="Dog Breed"
labelId="dog-breed-label"
name="dogBreed"
value={defaultDog.dogBreed}
onChange={event => setBankAccount({ ...dogBreed, dogBreed: event.target.value })}
inputRef={register({ required: true })}
variant="filled"
style={{ width: '100%' }}
inputProps={{ name: 'dogBreedInput' }}
inputRef={register({ required: true })}
>
<MenuItem value="CHIHUAHUA">Chihuahua</MenuItem>
<MenuItem value="LABRADOR">Labrador Retriever</MenuItem>
</Select>
</FormControl>
Warning Message (screenshot):
Missing name at {node: input, value: undefined, focus: ƒ}focus: ƒ focus()node: inputvalue: undefined__proto__: Object
in SelectInput (created by InputBase)
in InputBase (created by WithStyles(ForwardRef(InputBase)))
in WithStyles(ForwardRef(InputBase)) (created by FilledInput)
in FilledInput (created by WithStyles(ForwardRef(FilledInput)))
in WithStyles(ForwardRef(FilledInput)) (created by Select)
in Select (created by WithStyles(ForwardRef(Select)))
in WithStyles(ForwardRef(Select)) (at modal.js:95)
in Modal (at bankInformation/index.js:146)
in Anonymous (at demographics/index.js:199)
in Anonymous (at routes/index.js:16)
What do I need to add to avoid seeing this warning in the console?