We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
plugin-qiankun 的多实例场景,主应用会同时渲染多个 umi 子应用,而由于目前 umi 子应用的 mountElementId 是编译期固定的(plugin-qiankun 下子应用 root 节点默认为 root-slave),所以会存在 root id 冲突,导致子应用渲染冲突的问题
qiankun 目前在生命周期钩子的 props 中提供了 props.container 用于表明子应用处于父应用的哪个容器节点下,如果 mountElementId 支持配置成运行时 function,可以在子应用 mount 阶段将 mountElementId 设置成 props.container.querySelector(mountElementId),示例参考 https://github.com/umijs/qiankun/blob/master/examples/react15/index.js#L22
props.container
props.container.querySelector(mountElementId)
The text was updated successfully, but these errors were encountered:
feat: support to pass rootElement for client render (#5020)
738bb1b
PeachScript
Successfully merging a pull request may close this issue.
背景
plugin-qiankun 的多实例场景,主应用会同时渲染多个 umi 子应用,而由于目前 umi 子应用的 mountElementId 是编译期固定的(plugin-qiankun 下子应用 root 节点默认为 root-slave),所以会存在 root id 冲突,导致子应用渲染冲突的问题
思路
qiankun 目前在生命周期钩子的 props 中提供了
props.container
用于表明子应用处于父应用的哪个容器节点下,如果 mountElementId 支持配置成运行时 function,可以在子应用 mount 阶段将 mountElementId 设置成props.container.querySelector(mountElementId)
,示例参考 https://github.com/umijs/qiankun/blob/master/examples/react15/index.js#L22跟进
The text was updated successfully, but these errors were encountered: