When you need to change the password state, which is stored as an object with two properties,
value
andisTouched
, how should you correctly use thesetPassword
state setter inside theonChange
event handler?What’s the correct event prop you should use to determine when an input has been interacted with at least once?
onFocus
onBlur
onChange
How do you prevent the default behavior of the form HTML tag in React when a submission event occurs?
By returning false from the onSubmit function prop that the form tag provides.
By calling preventDefault on the event object inside any onChange handler from an input tag.
By calling preventDefault on the event object inside the onSubmit function prop from the form tag.