import React, { Component, PropTypes } from 'react'
import { reduxForm } from 'redux-form'
export const fields = [ 'firstName', 'lastName', 'email', 'sex', 'favoriteColor', 'employed', 'notes' ]
class SimpleForm extends Component {
render() {
const {
fields: { firstName, lastName, email, sex, favoriteColor, employed, notes },
handleSubmit,
resetForm,
submitting
} = this.props
return (<form onSubmit={handleSubmit}>
<div>
<label>First Name</label>
<div>
<input type="text" placeholder="First Name" {...firstName}/>
</div>
</div>
<div>
<label>Last Name</label>
<div>
<input type="text" placeholder="Last Name" {...lastName}/>
</div>
</div>
<div>
这是包中的一个Simple Form
示例redux-form
。我很困惑变量firstName
来自哪里。我在 ES6 语法中遗漏了什么吗?