In my redux-form app I have a Field that should be a custom component:
import Name from './NameComponent'
..
<Field
name="boer"
component={Name}
type="text"
placeholder="First Name"
/>
The component is NameComponent:
import React from 'react'
const Name= field => <div><input type="text">fill in here:</input></div>
export default Name;
When I run this CRA app I get this error, why? :
Uncaught Invariant Violation: input is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`. Check the render method of Name.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.