add proptypes to login form
This commit is contained in:
parent
7a07d5380d
commit
29013b99f1
1 changed files with 37 additions and 30 deletions
|
@ -1,10 +1,9 @@
|
||||||
import React from 'react';
|
import React, { PropTypes } from 'react';
|
||||||
|
|
||||||
class LoginForm extends React.Component {
|
function LoginForm(props) {
|
||||||
render() {
|
const { fields: { email, password }, handleSubmit } = props;
|
||||||
const { fields: { email, password }, handleSubmit } = this.props;
|
|
||||||
return (
|
return (
|
||||||
<form className="login-form" onSubmit={handleSubmit(this.props.loginUser.bind(this))}>
|
<form className="login-form" onSubmit={handleSubmit(props.loginUser.bind(this))}>
|
||||||
<p className="login-form__field">
|
<p className="login-form__field">
|
||||||
<label className="login-form__email-label" htmlFor="email">Email:</label>
|
<label className="login-form__email-label" htmlFor="email">Email:</label>
|
||||||
<input
|
<input
|
||||||
|
@ -29,6 +28,14 @@ class LoginForm extends React.Component {
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
LoginForm.propTypes = {
|
||||||
|
fields: PropTypes.shape({
|
||||||
|
username: PropTypes.string.isRequired,
|
||||||
|
password: PropTypes.string.isRequired
|
||||||
|
}).isRequired,
|
||||||
|
handleSubmit: PropTypes.func.isRequired,
|
||||||
|
loginUser: PropTypes.func.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
export default LoginForm;
|
export default LoginForm;
|
||||||
|
|
Loading…
Reference in a new issue