Hi there, I am using the npm package react-bootstrap for the first time and I was implementing a form for the login page. I am able to type in the email input, but when I try to type into the password input it doesn´t let me. What I am doing wrong?
export default class Login extends Component {
state = {
email: "",
password: ""
}
handleSubmit = (event) =>{
event.preventDefault()
console.log(this.state.email)
console.log(this.state.password)
}
onInputChange = event => {
this.setState({
[event.target.id]: event.target.value
})
};
render() {
return (
<div>
<Jumbotron className="jumbo" fluid>
<Container className="form-container text-center">
<h2>Log into your account</h2>
<Form onSubmit={this.handleSubmit} className="register-form">
<Form.Group as={Row} controlId="formPlaintextEmail">
<Form.Label column sm="2">
Email
</Form.Label>
<Col sm="10">
<Form.Control type="email" onChange={this.onInputChange} value={this.state.username} defaultValue="email@example.com" />
</Col>
</Form.Group>
<Form.Group as={Row} controlId="formPlaintextPassword">
<Form.Label column sm="2">
Password
</Form.Label>
<Col sm="10">
<Form.Control onChange={this.onInputChange} value={this.state.password} type="password" placeholder="Password" />
</Col>
</Form.Group>
<Button variant="primary" type="submit">
Submit
</Button>
</Form>
</Container>
</Jumbotron>
</div>
)
}
}