From 1a9fb01bcf64a4016fc8167f51871df1a85b692d Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 8 Apr 2019 20:53:45 +0300 Subject: Cleanup ESLint warnings --- vnext/src/App.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'vnext/src/App.js') diff --git a/vnext/src/App.js b/vnext/src/App.js index 6fcf3d9c..4931af0a 100644 --- a/vnext/src/App.js +++ b/vnext/src/App.js @@ -1,4 +1,6 @@ import React, { useState, useEffect } from 'react'; +import PropTypes from 'prop-types'; +import ReactRouterPropTypes from 'react-router-prop-types'; import { BrowserRouter as Router, Route, Link, Switch } from 'react-router-dom'; import qs from 'qs'; @@ -29,7 +31,7 @@ export default function App(props) { uid: 0, hash: cookies.load('hash') }); - + let updateStatus = () => { // refresh server visitor state (unread counters) me().then(visitor => { @@ -52,20 +54,20 @@ export default function App(props) { }; es.onerror = () => { es.removeEventListener('read', updateStatus); - } + }; setEs(es); }, []); - + let search = (history, pathname, searchString) => { let location = {}; location.pathname = pathname; location.search = `?search=${searchString}`; history.push(location); - } + }; let auth = (visitor) => { setVisitor(visitor); - } + }; return ( <> @@ -157,3 +159,8 @@ export default function App(props) { ); } + +App.propTypes = { + match: ReactRouterPropTypes.match.isRequired +}; + -- cgit v1.2.3