form
form copied to clipboard
Clear form after submit
I am searching for a way to clear the form after the form is submitted. Unfortunately can not find any example. I am using v1
I cant really help you too much with V1 as its not supported anymore.. with respect to both V1 and V2 however. There is a setAllValues api method that is exposed that allows you to set all of the values.. you could simply call setAllValues( { setting all your values to whatever you want } ) OR with V2 you can also simply call resetAll()
I was able to use instance.resetForm() where instance is available as argument in onSubmit (values, state, props, instance).