From 921696f40b027fae43a175cd034b1502fdd57253 Mon Sep 17 00:00:00 2001 From: chenos Date: Sun, 24 Mar 2024 12:51:41 +0800 Subject: [PATCH] fix: useExpressionScope (#3805) --- .../client/src/application/hoc/withDynamicSchemaProps.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/client/src/application/hoc/withDynamicSchemaProps.tsx b/packages/core/client/src/application/hoc/withDynamicSchemaProps.tsx index fc3d918ad..1fabb2dde 100644 --- a/packages/core/client/src/application/hoc/withDynamicSchemaProps.tsx +++ b/packages/core/client/src/application/hoc/withDynamicSchemaProps.tsx @@ -1,6 +1,7 @@ +import { useExpressionScope } from '@formily/react'; import { merge, omit } from 'lodash'; import React, { ComponentType, useMemo } from 'react'; -import { useDesignable, useSchemaComponentContext } from '../../schema-component'; +import { useDesignable } from '../../schema-component'; const useDefaultSchemaProps = () => undefined; @@ -12,7 +13,7 @@ export function withDynamicSchemaProps(Component: ComponentType, opt const displayName = options.displayName || Component.displayName || Component.name; const ComponentWithProps: ComponentType = (props) => { const { dn, findComponent } = useDesignable(); - const { scope } = useSchemaComponentContext(); + const scope = useExpressionScope(); const useComponentPropsStr = useMemo(() => { const xComponent = dn.getSchemaAttribute('x-component'); const xDecorator = dn.getSchemaAttribute('x-decorator');