Skip to content

Commit

Permalink
Fix getDOMNode warning
Browse files Browse the repository at this point in the history
  • Loading branch information
davkal committed Nov 16, 2015
1 parent 2000890 commit ee51247
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/app/scripts/components/sparkline.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Forked from: https://github.com/KyleAMathews/react-sparkline at commit a9d7c5203d8f240938b9f2288287aaf0478df013
const React = require('react');
const ReactDOM = require('react-dom');
const d3 = require('d3');

const Sparkline = React.createClass({
Expand All @@ -21,7 +22,7 @@ const Sparkline = React.createClass({

renderSparkline: function() {
// If the sparkline has already been rendered, remove it.
const el = this.getDOMNode();
const el = ReactDOM.findDOMNode(this);
while (el.firstChild) {
el.removeChild(el.firstChild);
}
Expand Down Expand Up @@ -89,9 +90,9 @@ const Sparkline = React.createClass({
title = data.length + ' samples, min: ' + d3.round(d3.min(data), 2) + ', max: ' + d3.round(d3.max(data), 2) + ', mean: ' + d3.round(d3.mean(data), 2);
}

d3.select(this.getDOMNode()).attr('title', title);
d3.select(ReactDOM.findDOMNode(this)).attr('title', title);

const svg = d3.select(this.getDOMNode()).
const svg = d3.select(ReactDOM.findDOMNode(this)).
append('svg').
attr('width', this.props.width).
attr('height', this.props.height).
Expand Down

0 comments on commit ee51247

Please sign in to comment.