Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Lines changed: 2 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /