Closed recursively closed 3 days ago
Next.js
中没有试过,我使用 CRA
暂时没有遇到过这个问题。
这种情况下你需要检查是否多次创建了 Graph 实例
参考一下:https://github.com/antvis/X6/issues/4430
因为React中默认开启StrictMode, 开发环境下Mount会执行两次, 导致创建了两个实例,这种情况下需要做一次销毁
解决方案:要么关闭严格模式,要么保证在每次渲染时销毁上一次的 graph 实例。
useEffect(() => {
return () => graph?.dispose();
}, []);
Describe the bug / 问题描述
版本5.0.19,在nextjs中拖动画布会在初始位置留下相同的布局,使用示例为官方示例
Reproduction link / 重现链接
No response
Steps to Reproduce the Bug or Issue / 重现步骤
官方示例代码:
初始布局:
拖动后会在初始位置留下一模一样的布局:
G6 Version / G6 版本
🆕 5.x
Operating System / 操作系统
macOS
Browser / 浏览器
Chrome, Edge
Additional context / 补充说明
No response