我的 ReactJS 项目中有一个 material-ui Textfield 组件。
当我运行我的代码时,我在控制台中得到的警告是:
Warning: Failed prop type: Invalid prop `error` of type `string` supplied to `ForwardRef(FormControl)`, expected `boolean`.
我的组件代码如下。
<Field label="First Name*" name="firstName" component={InputField} type="text" placeholder="First Name" className="form-control" />
这段代码完全正常,但问题是它在控制台中给出了一条警告消息。
警告:道具类型失败:提供给 error
的类型为 string
的无效道具 ForwardRef(TextField)
,预期为 boolean
。
是否有任何 ES6 或任何其他解决方案?