fix(client): element type is invalid
This commit is contained in:
parent
9fe90500cb
commit
011b1dc8e9
@ -4,7 +4,7 @@ import { SchemaComponentOptions } from '../schema-component';
|
|||||||
import { initializes as globals, items } from './Initializers';
|
import { initializes as globals, items } from './Initializers';
|
||||||
import { SchemaInitializer } from './SchemaInitializer';
|
import { SchemaInitializer } from './SchemaInitializer';
|
||||||
|
|
||||||
const SchemaInitializerContext = createContext(null);
|
const SchemaInitializerContext = createContext<any>({});
|
||||||
|
|
||||||
export interface SchemaInitializerProviderProps {
|
export interface SchemaInitializerProviderProps {
|
||||||
components?: any;
|
components?: any;
|
||||||
@ -19,13 +19,13 @@ export const useSchemaInitializer = (name: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!name) {
|
if (!name) {
|
||||||
return { exists: false, render };
|
return { exists: false, render: (props?: any) => render(null) };
|
||||||
}
|
}
|
||||||
|
|
||||||
const initializer = initializers?.[name];
|
const initializer = initializers?.[name];
|
||||||
|
|
||||||
if (!initializer) {
|
if (!initializer) {
|
||||||
return { exists: false, render };
|
return { exists: false, render: (props?: any) => render(null) };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPlainObj(initializer)) {
|
if (isPlainObj(initializer)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user