The reason is, in state you defined:
this.state = { fields: {} }
fields as a blank object, so during the first rendering this.state.fields.name
will be undefined
, and the input field will get its value as:
value={undefined}
Because of that, the input field will become uncontrolled.
Once you enter…
Top comments (0)