我原本以为这很容易......但是我在苦苦挣扎: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"/>
我无法在那里找到一个。
答案 0 :(得分:0)
在课堂外定义initialValues
const initialValues = {
email: 'example@gmail.com'
}
并将initialValues放在这里
export default reduxForm({
form: 'venues', // a unique identifier for this form
destroyOnUnmount: true,
validate,
initialValue
})(VenueComponent)