Skip to content

Commit 971bede

Browse files
avoids calling Plotly.x when not in browser context (#47)
1 parent 188d5fc commit 971bede

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/factory.js

+2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export default function plotComponentFactory(Plotly) {
7373
}
7474

7575
componentDidMount() {
76+
if (!isBrowser) return;
7677
this.p = this.p
7778
.then(() => {
7879
return Plotly.newPlot(this.el, {
@@ -95,6 +96,7 @@ export default function plotComponentFactory(Plotly) {
9596
}
9697

9798
componentWillUpdate(nextProps) {
99+
if (!isBrowser) return;
98100
this.p = this.p
99101
.then(() => {
100102
if (hasReactAPIMethod) {

0 commit comments

Comments
 (0)