lowcode-engine
lowcode-engine copied to clipboard
antd ConfigProvider 包裹 ReactRenderer,该 ConfigProvider未能生效
Describe the bug (required) / 详细描述 bug(必填)
A clear and concise description of what the bug is. / 请提供清晰且精确的 bug 描述
使用ReactRenderer渲染组件,想要配置内部组件的语言及主题等,一系列上下文相关的内容,实际包裹的ConfigProvider并不会生效
To Reproduce (required) / 如何复现 bug?(必填,非常重要)
Steps to reproduce the behavior: / 详细复现步骤:
https://github.com/alibaba/lowcode-demo/blob/main/demo-basic-antd/src/preview.tsx#L64 你们的demo直接在原地添加 ConfigProvider 即可复现
import zhCN from 'antd/lib/locale/zh_CN'
import { ConfigProvider } from 'antd';
...
ConfigProvider.config({
theme: {
primaryColor: '#25b864',
},
});
...
<div className="lowcode-plugin-sample-preview">
<ConfigProvider locale={zhCN}>
<ReactRenderer
className="lowcode-plugin-sample-preview-content"
schema={schema}
components={components}
appHelper={{
requestHandlersMap: {
fetch: createFetchHandler()
}
}}
/>
</ConfigProvider>
</div>
Expected behavior (required) / 预期行为(必填,非常重要)
A clear and concise description of what did you expect to happen. / 请清晰和精确的描述你预期的行为
configProvide 能够正常生效
Screenshots (optional) / bug 截图(可选)
Sceenshots for further information. (If applicable.) / 一些有用的截图将会帮助我们更好的明确以及定位问题
Environments (please complete the following information) (required): / 请提供如下信息(必填)
- AliLowCodeEngine version: [e.g. 1.0.0] / 低代码引擎版本
- AliLowCodeEngineExt version: [e.g. 1.0.0] / 低代码引擎扩展包版本
- Browser [e.g. chrome, safari] / 浏览器版本
- materials / plugins / tools / 其他物料 / 插件 / 工具链版本
(this information can be collected via the manual plugin / 版本信息可通过低代码用户手册插件收集)
Additional context (optional) / 更多额外信息(可选)
Any other context of the problem here. / 可以追加更多的额外信息,帮助定位问题
默认情况下,低代码页面里的antd和项目的中antd并不是一套,我们实现方案是仅配置设计态下加载外部的antd,默认不加载外部antd。渲染态和宿主工程中使用同一套antd。