Skip to content

Commit 838b189

Browse files
committed
Ensure propsNeedConfiguring is updated after field registration
1 parent 3eacf9b commit 838b189

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/connect-react/src/hooks/form-context.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,9 @@ export const FormContextProvider = <T extends ConfigurableProps>({
365365
}
366366
}
367367
// propsNeedConfiguring.splice(0, propsNeedConfiguring.length, ..._propsNeedConfiguring)
368+
// For some reason registerField is called in recursive loop if an empty
369+
// propsNeedConfiguring is set to an empty _propsNeedConfiguring
370+
if (!propsNeedConfiguring.length && !_propsNeedConfiguring.length) return
368371
setPropsNeedConfiguring(_propsNeedConfiguring)
369372
}
370373

@@ -373,6 +376,7 @@ export const FormContextProvider = <T extends ConfigurableProps>({
373376
fields[field.prop.name] = field
374377
return fields
375378
});
379+
checkPropsNeedConfiguring()
376380
};
377381

378382
// console.log("***", configurableProps, configuredProps)

0 commit comments

Comments
 (0)