![](/img/trans.png)
[英]Giving a default value to redux-form Field in a FieldArray when adding new Fields
[英]Giving an input a default value in redux-form
我本以為這很簡單...但是我在努力:D
<Field type="text" component="input" value="jamie" name="email" placeholder="Enter email address"/>
<Field type="text" component="input" defaultValue="jamie" name="email" placeholder="Enter email address"/>
<Field type="text" component="input" format="jamie" name="email" placeholder="Enter email address"/>
我只是不能在那里進來。
在類的外部定義initialValues
const initialValues = {
email: 'example@gmail.com'
}
並在此處放置initialValues
export default reduxForm({
form: 'venues', // a unique identifier for this form
destroyOnUnmount: true,
validate,
initialValue
})(VenueComponent)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.