这句话爆了警告
即:Warning: Input is changing an uncontrolled input of type text to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlle...
如果,我在initailValue传入不变的量string,就不会暴警告
为什么 呢?
I also have this problem, because it’s just a warning, not an error, and it doesn’t affect development, so I don’t care
The last link in the error you reported mentioned: A controlled <input> has a value prop. In your code, the value attribute does not appear.
Putting the execution result of a function into input is personally undesirable. You should save the execution result of this function in a variable in advance, and then put the variable into input, just like formItemLayout. I think this is better