react-validation icon indicating copy to clipboard operation
react-validation copied to clipboard

Getting Error with Input component <Input />

Open abhishekthakur1995 opened this issue 6 years ago • 0 comments

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}
 />
}

screenshot-2

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

abhishekthakur1995 avatar Aug 09 '18 09:08 abhishekthakur1995