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

代码销毁组件的问题 #18

Closed
wanglihuaya opened this issue Dec 8, 2022 · 3 comments
Closed

代码销毁组件的问题 #18

wanglihuaya opened this issue Dec 8, 2022 · 3 comments

Comments

@wanglihuaya
Copy link

老哥,我看代码里有写,卸载组件的时候销毁实例,但是一直没有触发,我怀疑是这个问题:

  // 销毁echarts实例
  const dispose = () => {
    if (canvasRef.current) {
      echarts?.dispose(canvasRef.current)
    }
  }

canvasRef.current 一直为null,我刚试了下,好像改成chartRef,就可以自己销毁了,不用我在外面再手动获取实例销毁了

老哥有时间看下这个问题

@qiuweikangdev
Copy link
Owner

那么细心,确实是,我等下修复一下

@wanglihuaya
Copy link
Author

那么细心,确实是,我等下修复一下

找 修了两天echarts内存泄漏的问题了😭

@qiuweikangdev
Copy link
Owner

已经修复更新了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants