From 0984766d32acc1c979d4f90992687ac85590d715 Mon Sep 17 00:00:00 2001 From: Samuel Male Date: Wed, 28 Aug 2024 20:40:03 +0300 Subject: [PATCH] Fix duplicate form registration (#369) --- src/provider/form-factory-provider.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/provider/form-factory-provider.tsx b/src/provider/form-factory-provider.tsx index 404ecb17..f6656404 100644 --- a/src/provider/form-factory-provider.tsx +++ b/src/provider/form-factory-provider.tsx @@ -83,7 +83,7 @@ export const FormFactoryProvider: React.FC = ({ const registerForm = useCallback((formId: string, context: FormContextProps) => { if (!rootForm.current) { rootForm.current = context; - } else { + } else if (rootForm.current.formJson.name !== formId) { subForms.current[formId] = context; } }, []);