fix(withDynamicSchemaProps): change deep merge to shallow merge (#3899)

* fix(withDynamicSchemaProps): change deep merge to shallow merge to avoid error

* refactor: remove useless code
This commit is contained in:
Zeke Zhang 2024-04-02 14:20:18 +08:00 committed by GitHub
parent a60aa65da6
commit 65b5504d65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,4 @@
import { useExpressionScope } from '@formily/react';
import { merge, omit } from 'lodash';
import React, { ComponentType, useMemo } from 'react';
import { useDesignable } from '../../schema-component';
@ -41,7 +40,7 @@ export function withDynamicSchemaProps<T = any>(Component: any, options: WithSch
const schemaProps = useSchemaProps(props);
const memoProps = useMemo(() => {
return merge(omit(props, 'children'), omit(schemaProps, 'children'));
return { ...props, ...schemaProps };
}, [schemaProps, props]);
return <Component {...memoProps}>{props.children}</Component>;