Skip to content

Commit

Permalink
Merge pull request #3022 from AndyJinSS/config-provider
Browse files Browse the repository at this point in the history
fix(renderer): remove the replacement 'div' for ConfigProvider when i…
  • Loading branch information
1ncounter authored Jul 3, 2024
2 parents deb50d1 + c860f5c commit 6950329
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 6950329

Please sign in to comment.