Why does a graph event is fired multiple times? What can be done to fix it? #514
Replies: 1 comment
-
That was happening because multiple event handlers were getting registered which can be avoid like so: useEffect(() => {
const afterlayoutHandler = () => console.log("after layout");
graph?.once('afterlayout', afterlayoutHandler)
return () => {
graph?.off('afterlayout', afterlayoutHandler)
}
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was trying to make use of a graph event
afterlayout
and happened to notice that it gets fired multiple times!This is far from ideal. What can be done to fix this?
Beta Was this translation helpful? Give feedback.
All reactions