diff --git a/src/components/Form.tsx b/src/components/Form.tsx index cb87afa37..52f5d6b5f 100644 --- a/src/components/Form.tsx +++ b/src/components/Form.tsx @@ -319,7 +319,12 @@ export const Form = (props: FormProps) => { if (formReadyCallback) { formReadyCallback(instance); } - setFormInstance(instance); + setFormInstance((prevInstance: any) => { + if (prevInstance) { + prevInstance.destroy(true); + } + return instance; + }); } else { console.warn('Failed to create form instance'); }