![](/img/trans.png)
[英]How to use the method formValueSelector of redux-form with a custom component to display an another component
[英]How to use custom component in redux-form?
在我的redux-form应用程序中,我有一个Field应该是自定义组件:
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.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.