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?
P粉3203612012024-02-18 15:18:53
You are missing the corresponding MenuItem
child component so Select
knows what to render.
Something like this should work:
See this ExampleStack Blitz