From 00a70b03b3c81dbe671cfda4792dc891a8b9c066 Mon Sep 17 00:00:00 2001 From: oem Date: Fri, 11 Sep 2015 13:53:33 +0100 Subject: [PATCH] avoid react 1.0.0 warnings --- src/react/DebugPanel.js | 2 +- src/react/LogMonitor.js | 11 ++++++----- src/react/LogMonitorEntry.js | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/react/DebugPanel.js b/src/react/DebugPanel.js index a14d3931..145acf17 100644 --- a/src/react/DebugPanel.js +++ b/src/react/DebugPanel.js @@ -28,7 +28,7 @@ export function getDefaultStyle(props) { }; } -export default class DebugPanel { +export default class DebugPanel extends React.Component { static propTypes = { left: PropTypes.bool, right: PropTypes.bool, diff --git a/src/react/LogMonitor.js b/src/react/LogMonitor.js index a3fc84c2..90bde6f8 100644 --- a/src/react/LogMonitor.js +++ b/src/react/LogMonitor.js @@ -1,4 +1,4 @@ -import React, { PropTypes, findDOMNode } from 'react'; +import React, { PropTypes } from 'react'; import LogMonitorEntry from './LogMonitorEntry'; import LogMonitorButton from './LogMonitorButton'; import * as themes from './themes'; @@ -32,8 +32,9 @@ const styles = { } }; -export default class LogMonitor { - constructor() { +export default class LogMonitor extends React.Component { + constructor(props) { + super(props); if (typeof window !== 'undefined') { window.addEventListener('keydown', ::this.handleKeyPress); } @@ -64,7 +65,7 @@ export default class LogMonitor { }; componentWillReceiveProps(nextProps) { - const node = findDOMNode(this.refs.elements); + const node = this.refs.elements; if (!node) { this.scrollDown = true; } else if ( @@ -81,7 +82,7 @@ export default class LogMonitor { } componentDidUpdate() { - const node = findDOMNode(this.refs.elements); + const node = this.refs.elements; if (!node) { return; } diff --git a/src/react/LogMonitorEntry.js b/src/react/LogMonitorEntry.js index cce7ea55..1256d3a7 100644 --- a/src/react/LogMonitorEntry.js +++ b/src/react/LogMonitorEntry.js @@ -12,7 +12,7 @@ const styles = { } }; -export default class LogMonitorEntry { +export default class LogMonitorEntry extends React.Component { static propTypes = { index: PropTypes.number.isRequired, state: PropTypes.object.isRequired,