Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Commit 792d904

Browse files
committed
allow for commonJS to bypass initializing
1 parent d435e56 commit 792d904

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

vars.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ module.exports = {
5656
}
5757

5858
var React = this.React || global.React;
59+
if (!React && (typeof require !== 'undefined') && (typeof define === 'function')) {
60+
// allow the charts to not need to be initialized for commonJS
61+
React = this.React = require('react');
62+
}
5963
if (!React) {
6064
throw new Error("The charts were not initialized with the React instance");
6165
}

0 commit comments

Comments
 (0)