使用微前端框架加载子应用,如果子应用中引入了 antd 的Modal 组件,每次加载都会在 document 上新增一个事件绑定,导致内存持续增长。
// 这句代码是在 Modal 引入时全局作用域下执行的。
document.documentElement.addEventListener('click', getClickPosition, true)
在 window unload 时解除这个全局的事件绑定。
在 window unload 时没有解除这个全局的事件绑定。
Environment | Info |
---|---|
antd | 5.14.1 |
React | 16.14.0 |
System | MacOS 13.2.1 (22D68) |
Browser | Chrome 121.0.6167.184 |
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too