Skip to content

Commit 05cbf80

Browse files
committed
ensure gd has not been unmounted before call Plotly.react
1 parent 074ad26 commit 05cbf80

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

components/dash-core-components/src/fragments/Graph.react.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,16 @@ class PlotlyGraph extends Component {
182182
gd.classList.add('dash-graph--pending');
183183

184184
return lazyLoadMathJax(mathjax)
185-
.then(() => Plotly.react(this.gd.current, figureClone))
185+
.then(() => {
186+
const gd = this.gd.current;
187+
188+
// double-check gd hasn't been unmounted
189+
if (!gd) {
190+
return;
191+
}
192+
193+
Plotly.react(gd, figureClone);
194+
})
186195
.then(() => {
187196
const gd = this.gd.current;
188197

0 commit comments

Comments
 (0)