core
core copied to clipboard
[BUG] 优化 TabView 状态更新,修复更新警告问题
描述你的问题(Describe the bug)
目前编辑器 TabView 视图在关闭时可以稳定复现该警告
初步定位原因为 TabView 关闭时会先发事件触发 forceUpdate(多次),随后再移除 DOM,导致在更新阶段节点被卸载导致该警告
代码位置见:https://github.com/opensumi/core/blob/3e9f22cd0b59287013f1b022a1fa8ab5066d839e/packages/editor/src/browser/tab.view.tsx#L57
复现路径(To Reproduce)
https://user-images.githubusercontent.com/9823838/178636197-ea355c46-85db-4bda-9d45-425e43cecc76.mp4
预期表现(Expected behavior)
精细化更新流程,减少 forceUpdate 的使用,修复该警告
@MMhunter 看下 ~
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
在 2.21.0 版本已修复