Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 17e4886

Browse files
committed
fix graph event removal on unmount
1 parent aeed80f commit 17e4886

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/Graph.react.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,9 @@ class PlotlyGraph extends Component {
212212
}
213213

214214
componentWillUnmount() {
215-
if (this.eventEmitter) {
216-
this.eventEmitter.removeAllListeners();
215+
const gd = document.getElementById(this.props.id);
216+
if (gd && gd.removeAllListeners) {
217+
gd.removeAllListeners();
217218
}
218219
window.removeEventListener('resize', this.graphResize);
219220
}

0 commit comments

Comments
 (0)