Skip to content

Getting Error with Input component <Input /> #170

@abhishekthakur1995

Description

@abhishekthakur1995

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions