Skip to content

Instantly share code, notes, and snippets.

@YKalashnikov
Last active June 8, 2018 00:04
Show Gist options
  • Save YKalashnikov/5e762d70d5cd7baefb4990766f71fe2c to your computer and use it in GitHub Desktop.
Save YKalashnikov/5e762d70d5cd7baefb4990766f71fe2c to your computer and use it in GitHub Desktop.
import React, {Component} from 'react';
import {Field, reduxForm} from 'redux-form';
class LoginForm extends Component {
render () {
const {handleSubmit} = this.props;
return (
<form onSubmit={handleSubmit}>
<Field
name="username"
component="input"
type="text"
placeholder="Username"
/>
<Field
name="password"
component="input"
type="password"
placeholder="Password"
/>
<button type="submit" label="submit">Submit</button>
</form>
);
}
}
LoginForm = reduxForm ({
form: 'login',
}) (LoginForm);
export default LoginForm;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment