我正在将应用程序的一部分从redux-form v5迁移到v6 (alpha-10)。我需要显示一些字段的组合值。
在v5中,我会有类似这样的东西:
class MyForm extends Component {
render() {
const { fields: { first, last }, handleSubmit } = this.props
return (
<form onSubmit={handleSubmit}>
<div>
<label>First name</label>
<input type="text" {...first}/>
</div>
<div>
<label>Last name</label>
<input type="text" {...last}/>
</div>
<div>
Welcome {first.value last.value.toUpperCase()}
</div>
<button type="submit">Submit</button>
</form>
)
}
}表单的最后一个div结合了我的两个first和last字段的值。如何使用v6创建这样的元素?
发布于 2016-05-16 22:55:35
刚刚为这件事发布了一个API。查看Selecting Form Values示例。
https://stackoverflow.com/questions/37244538
复制相似问题