Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(renderer): remove the replacement 'div' for ConfigProvider when i… #3022

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading