Recreate a password validator in React. Your final product should function similarly to this deployed version of the component.
- Fork and clone this repo
- Once you have the app locally, install necessary dependencies with
$ npm install
- Start the development server locally with
$ npm start
, then visitlocalhost:3000
in the browser to view app
Take the existing markup rendered from the Validator
component in src/Validator.js
and change into a fully functioning component. This means that you only have to add functionality -- not markup or styling -- to the existing code!
For this exercise, don't be concerned about the distinction between container and presentational components.
- Add your form inputs in
Validator.js
. - Add a constructor method and initialize state. Your state should include
email
,password
,passwordConfirm
, andvalid
properties.
this.state = {
email: '',
password: '',
passwordConfirm: '',
valid: true
}
- Add methods for handling inputs for password and password confirm, and checking that the passwords match. Be sure to update state in these methods using
.setState
- Bind the methods in the constructor.
- Display a message if the user's inputs are valid.