mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 03:02:19 +08:00
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:
parent
a60aa65da6
commit
65b5504d65
@ -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>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user