diff --git a/src/App.js b/src/App.js index b11d62b..af53e93 100644 --- a/src/App.js +++ b/src/App.js @@ -11,7 +11,7 @@ import './App.less'; import ChartsCount from './ChartsCount'; import TableData from './TableData'; import TabsRoute from './Router'; -import { Link, Route, Router, HashRouter, Switch } from 'react-router-dom'; +import { Link, Route, Router, HashRouter, Switch, useHistory } from 'react-router-dom'; const { TabPane } = Tabs; const { Header, Content, Footer, Sider } = Layout; @@ -82,18 +82,22 @@ class App extends React.Component { { + const history = useHistory(); + const { platform } = this.state; this.setState({ key: e }) switch (e) { case "content_table": - this.props.history.push("#/data") + history.push("#/data") + // this.props.history.push("#/data") if (this.refs.ctable) { this.refs.ctable.changePlatform(platform); } break; case "tag_count": - this.props.history.push("#/count") + history.push("#/count") + // this.props.history.push("#/count") if (this.refs.tcharts) { this.refs.tcharts.changePlatform(platform); } @@ -110,18 +114,12 @@ class App extends React.Component { - { - return - }} > - { - return - }} > + { + return + }} > - { - return - }} > { return }} >