我收到无法解决的警告:
value
标签上的props值无效。要么将其从元素中移除,要么传递一个字符串或数字值以将其保留在 DOM 中。详情
以下是我正在使用的代码:
<FormItem validateStatus={NameError ? "error" : ""} help={NameError || ""}>
{getFieldDecorator("Name", {
initialValue: (()=>{this.state.Data.Name}),
rules: [{ required: true, message: "Please input the component name!" }]
})(
<Input
className="form-control"
type="text"
name="Name"
defaultValue={this.state.Data.Name}
onChange={this.onChange}
/>
)}
</FormItem>
我的typescript界面如下所示:
export interface IFieldEdition{
Data:IFieldData
}
export interface IFieldData{
Id?:number,
Name?:string,
Value?:string,
Description?:string,
CreatedDate?:Date,
CreatedBy?:string,
StatusId?: number
}
我该如何解决这个问题?有什么线索吗?