I need some help how could I match the password in react js. I used ant design the first password is working but for conform password I put statement its not working how could I do it
handlePasswordChange = event => {
this.setState({
password: event.target.value,
});
};
handleConfirmPassword = event => {
if (event.handleConfirmPassword !== event.handlePasswordChange) {
message.error('error');
}
};
these are fun and below is the ant design
<FormItem {...styles.formItemLayout} label="Password">
{getFieldDecorator('Password', {
rules: [{ required: true, message: 'Password is Required!' }],
})(
<Input
onChange={this.handlePasswordChange}
name="password"
type="password"
value={password}
style={styles.margin}
/>,
)}
</FormItem>
<FormItem {...styles.formItemLayout} label="Confirm Password">
{getFieldDecorator('Confirm Password', {
rules: [{ required: true, message: 'Confirm your Password!' }],
})(
<Input
name="password"
type="password"
style={styles.margin}
onChange={this.handleConfirmPassword}
/>,
)}
</FormItem>