In the following example, the onChange
event fires each time the user type in a letter (like the onkeydown
event) is this the normal behavior?
import React from 'react';
export default class Form extends React.Component {
state = { name: '' };
_handleNameChanges = ({ target }) => {
this.setState({ name: target.value });
};
render() {
return (
<form>
<input
type="text"
name="name"
placeholder="John Doe"
onChange={this._handleNameChanges}
required
/>
</form>
);
}
}