在我的redux形式的应用程序中,我有一个应该是自定义组件的字段:
import Name from './NameComponent'
..
<Field
name="boer"
component={Name}
type="text"
placeholder="First Name"
/>
该组件是NameComponent:
import React from 'react'
const Name= field => <div><input type="text">fill in here:</input></div>
export default Name;
运行此CRA应用程序时出现此错误,为什么? :
Uncaught Invariant Violation: input is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`. Check the render method of Name.