1 | Warning: A component is changing an uncontrolled input of type text to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). |
原因
这是因为在给 input 的赋值的变量默认值是 undefined,做下处理,如果是 undefined 的就返回空字符串就行。
1 | <input |
1 | Warning: A component is changing an uncontrolled input of type text to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). |
这是因为在给 input 的赋值的变量默认值是 undefined,做下处理,如果是 undefined 的就返回空字符串就行。
1 | <input |