From 94284c6210716ea7b4f51a74c8ce3c36744a6507 Mon Sep 17 00:00:00 2001 From: chenos Date: Fri, 12 May 2023 10:20:02 +0800 Subject: [PATCH] fix: mode undefined --- .../antd/association-field/AssociationFieldProvider.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/association-field/AssociationFieldProvider.tsx b/packages/core/client/src/schema-component/antd/association-field/AssociationFieldProvider.tsx index d1f11e8cf..d8e09342a 100644 --- a/packages/core/client/src/schema-component/antd/association-field/AssociationFieldProvider.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/AssociationFieldProvider.tsx @@ -1,4 +1,4 @@ -import { useField, useFieldSchema, observer } from '@formily/react'; +import { observer, useField, useFieldSchema } from '@formily/react'; import React, { useMemo } from 'react'; import { useCollectionManager } from '../../../collection-manager'; import { AssociationFieldContext } from './context'; @@ -17,8 +17,8 @@ export const AssociationFieldProvider = observer((props) => { [fieldSchema['x-collection-field']], ); const currentMode = useMemo( - () => fieldSchema['x-component-props'].mode || (isFileCollection ? 'FileManager' : 'Select'), - [fieldSchema['x-component-props'].mode], + () => fieldSchema['x-component-props']?.mode || (isFileCollection ? 'FileManager' : 'Select'), + [fieldSchema['x-component-props']?.mode], ); return collectionField ? (