avoid react 1.0.0 warnings

This commit is contained in:
oem 2015-09-11 13:53:33 +01:00
parent 1d41c808a1
commit 00a70b03b3
3 changed files with 8 additions and 7 deletions

View File

@ -28,7 +28,7 @@ export function getDefaultStyle(props) {
}; };
} }
export default class DebugPanel { export default class DebugPanel extends React.Component {
static propTypes = { static propTypes = {
left: PropTypes.bool, left: PropTypes.bool,
right: PropTypes.bool, right: PropTypes.bool,

View File

@ -1,4 +1,4 @@
import React, { PropTypes, findDOMNode } from 'react'; import React, { PropTypes } from 'react';
import LogMonitorEntry from './LogMonitorEntry'; import LogMonitorEntry from './LogMonitorEntry';
import LogMonitorButton from './LogMonitorButton'; import LogMonitorButton from './LogMonitorButton';
import * as themes from './themes'; import * as themes from './themes';
@ -32,8 +32,9 @@ const styles = {
} }
}; };
export default class LogMonitor { export default class LogMonitor extends React.Component {
constructor() { constructor(props) {
super(props);
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
window.addEventListener('keydown', ::this.handleKeyPress); window.addEventListener('keydown', ::this.handleKeyPress);
} }
@ -64,7 +65,7 @@ export default class LogMonitor {
}; };
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
const node = findDOMNode(this.refs.elements); const node = this.refs.elements;
if (!node) { if (!node) {
this.scrollDown = true; this.scrollDown = true;
} else if ( } else if (
@ -81,7 +82,7 @@ export default class LogMonitor {
} }
componentDidUpdate() { componentDidUpdate() {
const node = findDOMNode(this.refs.elements); const node = this.refs.elements;
if (!node) { if (!node) {
return; return;
} }

View File

@ -12,7 +12,7 @@ const styles = {
} }
}; };
export default class LogMonitorEntry { export default class LogMonitorEntry extends React.Component {
static propTypes = { static propTypes = {
index: PropTypes.number.isRequired, index: PropTypes.number.isRequired,
state: PropTypes.object.isRequired, state: PropTypes.object.isRequired,