Skip to content

Commit

Permalink
fix(renderer): remove the replacement 'div' for ConfigProvider when i…
Browse files Browse the repository at this point in the history
…t is undefined
  • Loading branch information
AndyJinSS committed May 14, 2024
1 parent bd85ca3 commit 16c9a32
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions packages/renderer-core/src/renderer/renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function rendererFactory(): IRenderComponent {
const AppContext = contextFactory();
const Div = divFactory();

const ConfigProvider = adapter.getConfigProvider() || Div;
const ConfigProvider = adapter.getConfigProvider();

const debug = Debug('renderer:entry');

Expand Down Expand Up @@ -157,24 +157,25 @@ export default function rendererFactory(): IRenderComponent {
}

if (Comp) {
const comp = createElement(Comp, {
key: schema.__ctx && `${schema.__ctx.lceKey}_${schema.__ctx.idx || '0'}`,
ref: this.__getRef,
__appHelper: appHelper,
__components: allComponents,
__schema: schema,
__designMode: designMode,
...this.props,
});
return createElement(AppContext.Provider, {
value: {
appHelper,
components: allComponents,
engine: this,
},
}, createElement(ConfigProvider, {
}, ConfigProvider ? createElement(ConfigProvider, {
device: this.props.device,
locale: this.props.locale,
}, createElement(Comp, {
key: schema.__ctx && `${schema.__ctx.lceKey}_${schema.__ctx.idx || '0'}`,
ref: this.__getRef,
__appHelper: appHelper,
__components: allComponents,
__schema: schema,
__designMode: designMode,
...this.props,
})));
}, comp) : comp);
}
return null;
}
Expand Down

0 comments on commit 16c9a32

Please sign in to comment.