From 011b1dc8e9aef2d9900763f00831869902120167 Mon Sep 17 00:00:00 2001 From: chenos Date: Sat, 26 Mar 2022 08:29:35 +0800 Subject: [PATCH] fix(client): element type is invalid --- .../src/schema-initializer/SchemaInitializerProvider.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client/src/schema-initializer/SchemaInitializerProvider.tsx b/packages/client/src/schema-initializer/SchemaInitializerProvider.tsx index c0279f731..0acacee41 100644 --- a/packages/client/src/schema-initializer/SchemaInitializerProvider.tsx +++ b/packages/client/src/schema-initializer/SchemaInitializerProvider.tsx @@ -4,7 +4,7 @@ import { SchemaComponentOptions } from '../schema-component'; import { initializes as globals, items } from './Initializers'; import { SchemaInitializer } from './SchemaInitializer'; -const SchemaInitializerContext = createContext(null); +const SchemaInitializerContext = createContext({}); export interface SchemaInitializerProviderProps { components?: any; @@ -19,13 +19,13 @@ export const useSchemaInitializer = (name: string) => { }; if (!name) { - return { exists: false, render }; + return { exists: false, render: (props?: any) => render(null) }; } const initializer = initializers?.[name]; if (!initializer) { - return { exists: false, render }; + return { exists: false, render: (props?: any) => render(null) }; } if (isPlainObj(initializer)) {