From 134098d2bec184008adaf089cf07264e6e383dd1 Mon Sep 17 00:00:00 2001 From: chriskjaer Date: Fri, 11 Sep 2015 11:59:05 +0200 Subject: [PATCH] Extend component React 0.14 rc1 gives warnings if React.Component isn't extendend. See https://facebook.github.io/react/blog/2015/09/10/react-v0.14-rc1.html#new-deprecations-introduced-with-a-warning --- src/react/DebugPanel.js | 4 ++-- src/react/LogMonitor.js | 7 ++++--- src/react/LogMonitorEntry.js | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/react/DebugPanel.js b/src/react/DebugPanel.js index a14d3931..d58dc3b4 100644 --- a/src/react/DebugPanel.js +++ b/src/react/DebugPanel.js @@ -1,4 +1,4 @@ -import React, { PropTypes } from 'react'; +import React, { PropTypes, Component } from 'react'; export function getDefaultStyle(props) { let { left, right, bottom, top } = props; @@ -28,7 +28,7 @@ export function getDefaultStyle(props) { }; } -export default class DebugPanel { +export default class DebugPanel extends Component { static propTypes = { left: PropTypes.bool, right: PropTypes.bool, diff --git a/src/react/LogMonitor.js b/src/react/LogMonitor.js index a3fc84c2..8f25d283 100644 --- a/src/react/LogMonitor.js +++ b/src/react/LogMonitor.js @@ -1,4 +1,4 @@ -import React, { PropTypes, findDOMNode } from 'react'; +import React, { PropTypes, findDOMNode, Component } 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 Component { + constructor(props) { + super(props) if (typeof window !== 'undefined') { window.addEventListener('keydown', ::this.handleKeyPress); } diff --git a/src/react/LogMonitorEntry.js b/src/react/LogMonitorEntry.js index cce7ea55..e9edfb9c 100644 --- a/src/react/LogMonitorEntry.js +++ b/src/react/LogMonitorEntry.js @@ -1,4 +1,4 @@ -import React, { PropTypes } from 'react'; +import React, { PropTypes, Component } from 'react'; import JSONTree from 'react-json-tree'; import LogMonitorEntryAction from './LogMonitorEntryAction'; @@ -12,7 +12,7 @@ const styles = { } }; -export default class LogMonitorEntry { +export default class LogMonitorEntry extends Component { static propTypes = { index: PropTypes.number.isRequired, state: PropTypes.object.isRequired,