Como esvaziar o campo de entrada no React
event.target.value = ''
//grab the target input and set it empty. you can use it in the onclick
event.target.value = ''
//grab the target input and set it empty. you can use it in the onclick
e.target.value = null;
cancelCourse = () => {
document.getElementById("create-course-form").reset();
}
render() {
return (
<form id="create-course-form">
<input />
<input />
...
<input />
</form>
);
}
Clear input field