1
我使用的是组件的加载形式,我从api响应中获得我的文本字段的值,当我填充并提交这些值时,因为我没有触及域 - 我我看到验证错误 - 就像它们是空的 - 如何将这些现有值传递给道具?Redux窗体预先填充的数据
const emailValfromapi = this.props.data && this.props.data.email ? this.props.data.email : [];
const { handleSubmit, fields: { email, abc, def, etc } } = this.props;
<fieldset className="form-group">
<div className="input-wrapper">
<input value={emailValfromapi} id="email" {...email} type="email" className={email.touched && email.error ? 'error-red' : ''} required />
<label className="input-label" htmlFor="Email">To</label>
{ email.touched && email.error && <div className="alert-danger"> { email.error } </div> }
</div>
</fieldset>