From 3591123e5095d4943cd94679c7c79f20b1020610 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Wed, 21 Feb 2018 16:21:53 -0500 Subject: [PATCH] avoids calling Plotly.x when not in browser context --- src/factory.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/factory.js b/src/factory.js index 0e13d4b..00d513e 100644 --- a/src/factory.js +++ b/src/factory.js @@ -73,6 +73,7 @@ export default function plotComponentFactory(Plotly) { } componentDidMount() { + if (!isBrowser) return; this.p = this.p .then(() => { return Plotly.newPlot(this.el, { @@ -95,6 +96,7 @@ export default function plotComponentFactory(Plotly) { } componentWillUpdate(nextProps) { + if (!isBrowser) return; this.p = this.p .then(() => { if (hasReactAPIMethod) {