I made a React controlled component for the password input field:
onPasswordChange(ev) {
this.setState({
passoword: ev.target.value
});
}
<input
value={this.state.password}
onChange={this.onPasswordChange}
>
As you can see in the image below if the component is controlled we can see the password value if I go and inspect the element. My question is: Is this the right way to control a password input? (security wise).
I know that I can use the ref={} on the input field but I want to know the best practices on handling password fields.