fix: return first if input schema is a react dom

This commit is contained in:
Minglong Li 2023-05-12 21:50:44 +08:00 committed by 刘菊萍(絮黎)
parent 5ada0a4020
commit f5438ff1ab

View File

@ -493,6 +493,11 @@ export default function baseRendererFactory(): IBaseRenderComponent {
return schema.map((item, idy) => this.__createVirtualDom(item, scope, parentInfo, (item as IPublicTypeNodeSchema)?.__ctx?.lceKey ? '' : String(idy)));
}
// @ts-expect-error 如果直接转换好了,可以返回
if (schema.$$typeof) {
return schema;
}
const _children = getSchemaChildren(schema);
if (!schema.componentName) {
logger.error('The componentName in the schema is invalid, please check the schema: ', schema);
@ -510,11 +515,6 @@ export default function baseRendererFactory(): IBaseRenderComponent {
schema.children = [text];
}
// @ts-expect-error 如果直接转换好了,可以返回
if (schema.$$typeof) {
return schema;
}
if (!isSchema(schema)) {
return null;
}