I\'m presented with a rather silly problem. I am in the process of creating my first React application and I have encountered a little issue, where I am not able to clear my
You are having a controlled component where input value is determined by this.state.city. So once you submit you have to clear your state which will clear your input automatically.
onHandleSubmit(e) {
e.preventDefault();
const city = this.state.city;
this.props.onSearchTermChange(city);
this.setState({
city: ''
});
}