diff --git a/lib/core.js b/lib/core.js index 08a2f17..5440c0a 100644 --- a/lib/core.js +++ b/lib/core.js @@ -1,3 +1,6 @@ +var ReactDOM = require('react-dom'); + + module.exports = { createClass: function(chartType, methodNames, dataKey) { var classData = { @@ -50,7 +53,7 @@ module.exports = { classData.initializeChart = function(nextProps) { var Chart = require('chart.js'); - var el = this.getDOMNode(); + var el = ReactDOM.findDOMNode(this); var ctx = el.getContext("2d"); var chart = new Chart(ctx)[chartType](nextProps.data, nextProps.options || {}); this.state.chart = chart; @@ -63,7 +66,7 @@ module.exports = { // return the canvass element that contains the chart classData.getCanvass = function() { - return this.refs.canvass.getDOMNode(); + return this.refs.canvass; }; classData.getCanvas = classData.getCanvass;