I have destructed the "password" and "retypepassword" properties from the state, now trying to apply a condition on them. When I am using the if and else statement it's working perfectly fine but when I am using the ternary operator it's not working. I have checked the format of the ternary operator, it's the same as I have written but still not working.
Please let me know what I am doing wrong!
SubmitHandler = e => {
e.preventDefault();
const { password, retypepassword } = this.state;
// if (password === retypepassword) {
// console.log("password not match");
// } else console.log(this.state);
password === retypepassword
? return(console.log("form submitted"))
: "password does not match";
};