react-validation
react-validation copied to clipboard
Getting Error with Input component <Input />
I am getting this weird error due to <Input />
component provided by react validation
.
This issues comes when I try to change to state in componentDidMount()
LoginPage.js
import Input from 'react-validation/build/input'
.
.
.
componentDidMount() {
// If user is already authenticated redirect him to dashboard page.
if (userAuth.isUserAuthenticated() === true) {
this.setState({
redirectToReferrer: true
})
}
}
.
.
.
render() {
<Input
type="password"
autoComplete="on"
name="password"
validations={[required]}
className="form-control"
value={this.state.fields.password}
onChange={this.handleChange}
/>
}
If I replace <Input />
type with <FormControl />
from react-bootstrap
this issue resolves so I guess the reason for this issue is <Input />
provided by react-validation