We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d57d0ff + 94bc2ab commit b1c1a73Copy full SHA for b1c1a73
1 file changed
src/components/Form.tsx
@@ -321,7 +321,12 @@ export const Form = (props: FormProps) => {
321
if (formReadyCallback) {
322
formReadyCallback(instance);
323
}
324
- setFormInstance(instance);
+ setFormInstance((prevInstance: any) => {
325
+ if (prevInstance) {
326
+ prevInstance.destroy(true);
327
+ }
328
+ return instance;
329
+ });
330
} else {
331
console.warn('Failed to create form instance');
332
0 commit comments