I'm new to react and I'm having a hard time figuring out why my defaultValueAttributes doesn't display anything:
<Select id="my_disabled_select" name="my_disabled_select" disabled defaultValue={connectedUser.options[0]} />
I tried showing connectedUser.options[0]
in the InputLabel tag and the value is defined!
Does anyone know why this happens and how to fix it?
You are missing the corresponding
MenuItem
child component soSelect
knows what to render.Something like this should work:
See this ExampleStack Blitz