From 38320fe489c2a5a01f9a5fee6119e9c62bba1c46 Mon Sep 17 00:00:00 2001 From: Zeke Zhang <958414905@qq.com> Date: Thu, 31 Oct 2024 08:49:30 +0800 Subject: [PATCH] refactor(CollectionFieldInternalField): remove useless code --- .../data-source/collection-field/CollectionField.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/core/client/src/data-source/collection-field/CollectionField.tsx b/packages/core/client/src/data-source/collection-field/CollectionField.tsx index 77cd4692a2..12cde9197d 100644 --- a/packages/core/client/src/data-source/collection-field/CollectionField.tsx +++ b/packages/core/client/src/data-source/collection-field/CollectionField.tsx @@ -9,7 +9,6 @@ import { Field } from '@formily/core'; import { connect, Schema, useField, useFieldSchema } from '@formily/react'; -import { untracked } from '@formily/reactive'; import { merge } from '@formily/shared'; import { concat } from 'lodash'; import React, { useEffect } from 'react'; @@ -24,11 +23,9 @@ type Props = { }; const setFieldProps = (field: Field, key: string, value: any) => { - untracked(() => { - if (field[key] === undefined) { - field[key] = value; - } - }); + if (field[key] === undefined) { + field[key] = value; + } }; const setRequired = (field: Field, fieldSchema: Schema, uiSchema: Schema) => { @@ -78,7 +75,7 @@ export const CollectionFieldInternalField: React.FC = (props: Props) => { setRequired(field, fieldSchema, uiSchema); // @ts-ignore field.dataSource = uiSchema.enum; - const originalProps = compile(uiSchema['x-component-props']) || {}; + const originalProps = uiSchema['x-component-props'] || {}; field.componentProps = merge(originalProps, field.componentProps || {}, dynamicProps || {}); }, [uiSchemaOrigin]);