From 468f40020b7a5ec3b8f4e75f7cd7fa6b0c77a50d Mon Sep 17 00:00:00 2001 From: Andrew Red Date: Tue, 27 Dec 2016 18:39:33 +0300 Subject: [PATCH] Prevent server error cause c3 uses window --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index d40b129..7a255cb 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ import React from 'react'; import { findDOMNode } from 'react-dom'; -import c3 from 'c3'; +let c3; class C3Chart extends React.Component { static get displayName() { @@ -42,6 +42,7 @@ class C3Chart extends React.Component { } componentDidMount() { + c3 = require('c3'); this.updateChart(this.props); }