fix: should shadow merge
This commit is contained in:
parent
4a0575985e
commit
7d500fe1c9
@ -1,5 +1,4 @@
|
|||||||
import { useExpressionScope } from '@nocobase/schema';
|
import { useExpressionScope } from '@nocobase/schema';
|
||||||
import { merge, omit } from 'lodash';
|
|
||||||
import React, { ComponentType, useMemo } from 'react';
|
import React, { ComponentType, useMemo } from 'react';
|
||||||
import { useDesignable } from '../../schema-component';
|
import { useDesignable } from '../../schema-component';
|
||||||
|
|
||||||
@ -41,7 +40,7 @@ export function withDynamicSchemaProps<T = any>(Component: any, options: WithSch
|
|||||||
const schemaProps = useSchemaProps(props);
|
const schemaProps = useSchemaProps(props);
|
||||||
|
|
||||||
const memoProps = useMemo(() => {
|
const memoProps = useMemo(() => {
|
||||||
return merge(omit(props, 'children'), omit(schemaProps, 'children'));
|
return { ...props, ...schemaProps };
|
||||||
}, [schemaProps, props]);
|
}, [schemaProps, props]);
|
||||||
|
|
||||||
return <Component {...memoProps}>{props.children}</Component>;
|
return <Component {...memoProps}>{props.children}</Component>;
|
||||||
|
Loading…
Reference in New Issue
Block a user