React.js and HTML5 authentication

I have an email input in my response component:

                <input
                  type="email"
                  autoComplete="email"
                  placeholder="Email"
                  required
                  value={this.state.formData.email}
                  onChange={this.handleFieldChange('email')}
                />

which gives me a warning in the console:

 The specified value "myemail" is not a valid email address.

with each keystroke until you enter the correct email address. I believe this is the default HTML5 email verification message, and since I change my state with every keystroke, I react to the changes, and HTML5 checks it again. Changing the type to “text” corrects it, but I would like to save it as “email”. What would be the right way to handle this in the reaction to avoid these html5 warnings?

+4
source share
2 answers

React Element.prototype.setAttribute() , , Chrome 52 ( ), , . -, HTML5.

DOMPropertyOperations.setValueForProperty() React, 162 ( 15.3.0) <input> s.

+4

<form>? novalidate , HTML5. , HTML5? HTML5, .

, , . , .

+1

Source: https://habr.com/ru/post/1651459/


All Articles