Warning about discarded messages in the console. to react

When I try to change the state of the input[type="email"] on onChange using this.setState({email: e.target.value}) , I get this bunch of warnings in the console (Chrome browser):

 DOMPropertyOperations.js:143 The specified value "s" is not a valid email address. DOMPropertyOperations.js:143 The specified value "so" is not a valid email address. DOMPropertyOperations.js:143 The specified value "som" is not a valid email address. DOMPropertyOperations.js:143 The specified value "some" is not a valid email address. 

This strange behavior occurs when you change state , if you pass props data props , everything works fine.

Any ideas?

PS I added noValidate to the form.

+6
source share
1 answer

There is good documentation on what kind of verification you can do on email inputs, read this and make changes to the form:

Validating Data Forms - Guides for Web Developers | MDN

Confirm the correctness of REGEX and decide whether you want to conduct a live test (keyup, keypress) or just lose focus on this input. Hope this helps you better understand, and also helps you solve your problem.

0
source

All Articles