diff --git a/packages/core/client/src/application/schema-settings/SchemaSettings.tsx b/packages/core/client/src/application/schema-settings/SchemaSettings.tsx index 45f6d7969..595f3f63b 100644 --- a/packages/core/client/src/application/schema-settings/SchemaSettings.tsx +++ b/packages/core/client/src/application/schema-settings/SchemaSettings.tsx @@ -11,7 +11,6 @@ export class SchemaSettings { constructor(options: SchemaSettingOptions) { this.options = Object.assign({ items: [] }, options); - this.options.items = defaultSettingItems.concat(this.items); this.name = options.name; } diff --git a/packages/core/client/src/application/schema-settings/hooks/index.tsx b/packages/core/client/src/application/schema-settings/hooks/index.tsx index aefc9841b..c6149ef22 100644 --- a/packages/core/client/src/application/schema-settings/hooks/index.tsx +++ b/packages/core/client/src/application/schema-settings/hooks/index.tsx @@ -7,6 +7,7 @@ import { SchemaSettingsProps } from '../../../schema-settings'; import { Schema } from '@tachybase/schema'; import { GeneralField } from '@tachybase/schema'; import { Designable } from '../../../schema-component'; +import { defaultSettingItems } from '../SchemaSettingsDefaults'; type UseSchemaSettingsRenderOptions = Omit, 'name' | 'items'> & Omit & { @@ -40,8 +41,9 @@ export function useSchemaSettingsRender(name: string, options?: UseSchem if (key && renderCache.current[key]) { return renderCache.current[key]; } + const newItems = [...defaultSettingItems, ...schemaSetting.options.items]; return (renderCache.current[key] = React.createElement(SchemaSettingsWrapper, { - ...schemaSetting.options, + ...{ ...schemaSetting.options, items: newItems }, ...options, ...options2, }));