diff --git a/.eslintrc b/.eslintrc index 7fb6d974..64d816c4 100644 --- a/.eslintrc +++ b/.eslintrc @@ -36,6 +36,7 @@ "dot-notation": "error", "eqeqeq": ["error", "smart"], "guard-for-in": "error", + "lines-between-class-members": "error", "max-depth": ["warn", 4], "max-params": ["warn", 5], "new-cap": "error", diff --git a/js/components/App.js b/js/components/App.js index 8c8630a7..c5e198a9 100644 --- a/js/components/App.js +++ b/js/components/App.js @@ -26,14 +26,17 @@ class App extends React.Component { this._windowNodes = {}; this._bindings = {}; } + componentDidMount() { this._setFocus(); } + componentDidUpdate(prevProps) { if (prevProps.focused !== this.props.focused) { this._setFocus(); } } + _setFocus() { const binding = this._bindings[this.props.focused]; if (binding.node) { @@ -68,6 +71,7 @@ class App extends React.Component { } }; } + _renderWindows() { const { media, @@ -123,6 +127,7 @@ class App extends React.Component { } }); } + render() { const { closed, container, filePickers } = this.props; if (closed) { diff --git a/js/components/ClickedDiv.js b/js/components/ClickedDiv.js index ef33ef5e..5a938dfe 100644 --- a/js/components/ClickedDiv.js +++ b/js/components/ClickedDiv.js @@ -12,6 +12,7 @@ export default class ClickedDiv extends React.Component { super(props); this.state = { clicked: false }; } + render() { return (