my formData is getting blank before submit because of setState before submit of form in react js code example Example: how to empty form after submit react e.target.reset();