onsubmit reset form react js code example Example: how to empty form after submit react e.target.reset();