From f77d98e00edda1f5f9a24fdbc697d9a01480bbb8 Mon Sep 17 00:00:00 2001 From: Daniel Rech Date: Sun, 20 Sep 2015 16:10:54 +0200 Subject: [PATCH 1/2] Make react-charts compatible with react@0.14.0-rc1 --- lib/core.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; From 77b34d7b5bcf36a2510b70cd12e3149073da255d Mon Sep 17 00:00:00 2001 From: Jimmy Oliger Date: Fri, 9 Oct 2015 11:32:00 +0200 Subject: [PATCH 2/2] add react-dom in peerDependencies --- lib/core.js | 4 +--- package.json | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/core.js b/lib/core.js index 5440c0a..2765ed2 100644 --- a/lib/core.js +++ b/lib/core.js @@ -1,6 +1,6 @@ +var React = require('react'); var ReactDOM = require('react-dom'); - module.exports = { createClass: function(chartType, methodNames, dataKey) { var classData = { @@ -79,7 +79,6 @@ module.exports = { extra(methodNames[i]); } - var React = require('react'); return React.createClass(classData); } }; @@ -124,4 +123,3 @@ var addData = function(nextProps, chart, setIndex, pointIndex) { }); chart.addData(values, nextProps.data.labels[setIndex]); }; - diff --git a/package.json b/package.json index 46273a1..ac3f75c 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "homepage": "https://github.com/jhudson8/react-chartjs", "peerDependencies": { "react": "*", + "react-dom": "*", "chart.js": "*" }, "devDependencies": {