Skip to content

Commit 06dbf82

Browse files
committed
fix(renderer): optimize code
1 parent 5689c45 commit 06dbf82

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ export default function rendererFactory(): IRenderComponent {
125125
getComp() {
126126
const { schema, components } = this.props;
127127
const { componentName } = schema;
128-
const allComponents = { ...RENDERER_COMPS, ...components };
129-
let Comp = allComponents[componentName] || RENDERER_COMPS[`${componentName}Renderer`];
128+
let Comp = components[componentName]
130129
if (Comp && Comp.prototype) {
131130
if (!(Comp.prototype instanceof BaseRenderer)) {
132131
Comp = RENDERER_COMPS[`${componentName}Renderer`];
@@ -142,7 +141,6 @@ export default function rendererFactory(): IRenderComponent {
142141
}
143142
// 兼容乐高区块模板
144143
if (schema.componentName !== 'Div' && !isFileSchema(schema)) {
145-
logger.error('The root component name needs to be one of Page、Block、Component, please check the schema: ', schema);
146144
return '模型结构异常';
147145
}
148146
debug('entry.render');

0 commit comments

Comments
 (0)