Last active
May 12, 2016 14:42
-
-
Save DanielMSchmidt/e1d38f9e8bad240ea816e2de3fffb602 to your computer and use it in GitHub Desktop.
redux-form + autofill
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@reduxForm({ | |
form: 'login', | |
fields: ['email', 'password'], | |
validate: validation // email and password are both required | |
}) | |
class LoginForm extends Component { | |
static propTypes = { | |
fields: PropTypes.object.isRequired, | |
handleSubmit: PropTypes.func.isRequired, | |
} | |
render() { | |
const { | |
handleSubmit, | |
fields: { | |
email, | |
password | |
} | |
} = this.props; | |
return ( | |
<form onSubmit={handleSubmit}> | |
<Row> | |
<Input | |
type="text" | |
{...email} /> | |
<Input | |
type="password" | |
{...password} /> | |
</Row> | |
<Button type="submit"> | |
... | |
</Button> | |
</form> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment