Skip to content

Commit

Permalink
Fix example login issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 14, 2018
1 parent 59b5d10 commit b3f9173
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions templates/router-redux-rematch/src/routes/Login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ class Login extends PureComponent {
}
onChange(type, e) {
const { form } = this.state;
form[type] = e.target.value;
this.setState({ form });
const formData = { ...form };
formData[type] = e.target.value;
this.setState({ form: formData });
}
render() {
const { form } = this.state;
return (
<div className={styles.login}>
<FormItem label="Username" value={form.username} onChange={this.onChange.bind(this, 'username')} placeholder="Username" />
<FormItem label="Password" value={form.password} onChange={this.onChange.bind(this, 'username')} placeholder="Type your password" />
<FormItem label="Password" type="password" value={form.password} onChange={this.onChange.bind(this, 'password')} placeholder="Type your password" />
<button className={styles.btn} onClick={this.login.bind(this)}>
Login
</button>
Expand Down

0 comments on commit b3f9173

Please sign in to comment.