diff --git a/ui/package.json b/ui/package.json index 19a8274f8..46b603580 100644 --- a/ui/package.json +++ b/ui/package.json @@ -40,6 +40,7 @@ "@types/node": "^9.4.6", "@types/prop-types": "^15.5.2", "@types/react": "^16.0.38", + "@types/react-router": "3", "autoprefixer": "^6.3.1", "babel-core": "^6.5.1", "babel-eslint": "6.1.2", diff --git a/ui/src/CheckSources.tsx b/ui/src/CheckSources.tsx index a0289076d..67083c15d 100644 --- a/ui/src/CheckSources.tsx +++ b/ui/src/CheckSources.tsx @@ -1,6 +1,7 @@ import React, {ReactElement, Component} from 'react' import PropTypes from 'prop-types' -import {withRouter, Params, Router, Location} from 'react-router' +import {withRouter, InjectedRouter} from 'react-router' +import {Location} from 'history' import {connect} from 'react-redux' import {bindActionCreators} from 'redux' @@ -32,12 +33,16 @@ interface State { isFetching: boolean } +interface Params { + sourceID: string +} + interface Props { getSources: () => void sources: Source[] children: ReactElement params: Params - router: Router + router: InjectedRouter location: Location auth: Auth notify: () => void diff --git a/ui/src/data_explorer/containers/DataExplorerPage.tsx b/ui/src/data_explorer/containers/DataExplorerPage.tsx index de6bfd0fd..a4a422478 100644 --- a/ui/src/data_explorer/containers/DataExplorerPage.tsx +++ b/ui/src/data_explorer/containers/DataExplorerPage.tsx @@ -1,5 +1,4 @@ import React, {PureComponent} from 'react' -import {withRouter} from 'react-router' import DataExplorer from './DataExplorer' import {Source} from 'src/types' @@ -18,4 +17,4 @@ class DataExplorerPage extends PureComponent { } } -export default withRouter(DataExplorerPage) +export default DataExplorerPage diff --git a/ui/tsconfig.json b/ui/tsconfig.json index f5cb170d8..c585ab2e3 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -7,7 +7,8 @@ "enzyme", "react", "prop-types", - "jest" + "jest", + "react-router" ], "target": "es6", "module": "es2015", diff --git a/ui/yarn.lock b/ui/yarn.lock index cb262a2d7..dfbdf9154 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -41,6 +41,10 @@ "@types/cheerio" "*" "@types/react" "*" +"@types/history@^3": + version "3.2.2" + resolved "https://registry.yarnpkg.com/@types/history/-/history-3.2.2.tgz#b6affa240cb10b5f841c6443d8a24d7f3fc8bb0c" + "@types/jest@^22.1.4": version "22.2.0" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-22.2.0.tgz#55ce83139f7ad1b48b414c3927746614c6963c0f" @@ -57,6 +61,13 @@ version "15.5.2" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.5.2.tgz#3c6b8dceb2906cc87fe4358e809f9d20c8d59be1" +"@types/react-router@3": + version "3.0.15" + resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-3.0.15.tgz#b55b0dc5ad8f6fa66b609f0efc390b191381d082" + dependencies: + "@types/history" "^3" + "@types/react" "*" + "@types/react@*", "@types/react@^16.0.38": version "16.0.40" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.40.tgz#caabc2296886f40b67f6fc80f0f3464476461df9"