fix(client): element type is invalid

This commit is contained in:
chenos 2022-03-26 08:29:35 +08:00
parent 9fe90500cb
commit 011b1dc8e9

View File

@ -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<any>({});
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)) {