form icon indicating copy to clipboard operation
form copied to clipboard

Clear form after submit

Open AKNiazi opened this issue 9 years ago • 2 comments

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

AKNiazi avatar Nov 09 '17 17:11 AKNiazi

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()

joepuzzo avatar Nov 10 '17 03:11 joepuzzo

I was able to use instance.resetForm() where instance is available as argument in onSubmit (values, state, props, instance).

AKNiazi avatar Nov 10 '17 05:11 AKNiazi