fix: conditions on conditionals

This commit is contained in:
Dan Ribbens
2022-09-13 11:53:52 -04:00
parent bcfda707ff
commit 9c4f2b68b0
2 changed files with 2 additions and 2 deletions

View File

@@ -88,7 +88,7 @@ const RenderFields: React.FC<Props> = (props) => {
DefaultComponent={FieldComponent}
componentProps={{
...field,
path: field.path || (isFieldAffectingData ? field.name : undefined),
path: field.path || (isFieldAffectingData ? field.name : ''),
fieldTypes,
admin: {
...(field.admin || {}),

View File

@@ -28,7 +28,7 @@ const withCondition = <P extends Record<string, unknown>>(Field: React.Component
path?: string
};
const path = pathFromProps || name;
const path = typeof pathFromProps === 'string' ? pathFromProps : name;
const { getData, getSiblingData, getField, dispatchFields } = useWatchForm();