Skip to content

Commit

Permalink
🐛 fix: 修正自动刷新时的 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Mar 17, 2021
1 parent 5601575 commit b6302e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/mindflow/src/hooks/useGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export const useGraph = (data) => {
new Graph(graphOpts(container.current, minimapContainer.current)),
);
}
}, [container, graph]);
return () => {
setGraph(null);
};
}, [container]);

// 更新数据
useEffect(() => {
Expand Down

0 comments on commit b6302e4

Please sign in to comment.