How to track changes if the value of the input field is already there. Probably it will be necessary to make the button active
class NameForm extends React.Component {
constructor(props) {
super(props);
this.state = {value: ''};
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
handleChange(event) {
this.setState({value: event.target.value});
}
render() {
return (
<form onSubmit={this.handleSubmit}>
<label>
Name:
<input type="text" value="John" />
</label>
<input type="submit" value="send" />
</form>
);
}
}