Skip to content

Commit f5438ff

Browse files
proclmlliujuping
authored andcommitted
fix: return first if input schema is a react dom
1 parent 5ada0a4 commit f5438ff

File tree

1 file changed

+5
-5
lines changed
  • packages/renderer-core/src/renderer

1 file changed

+5
-5
lines changed

packages/renderer-core/src/renderer/base.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,11 @@ export default function baseRendererFactory(): IBaseRenderComponent {
493493
return schema.map((item, idy) => this.__createVirtualDom(item, scope, parentInfo, (item as IPublicTypeNodeSchema)?.__ctx?.lceKey ? '' : String(idy)));
494494
}
495495

496+
// @ts-expect-error 如果直接转换好了,可以返回
497+
if (schema.$$typeof) {
498+
return schema;
499+
}
500+
496501
const _children = getSchemaChildren(schema);
497502
if (!schema.componentName) {
498503
logger.error('The componentName in the schema is invalid, please check the schema: ', schema);
@@ -510,11 +515,6 @@ export default function baseRendererFactory(): IBaseRenderComponent {
510515
schema.children = [text];
511516
}
512517

513-
// @ts-expect-error 如果直接转换好了,可以返回
514-
if (schema.$$typeof) {
515-
return schema;
516-
}
517-
518518
if (!isSchema(schema)) {
519519
return null;
520520
}

0 commit comments

Comments
 (0)