Merge pull request #3127 from influxdata/chore/add-react-router-types

Add @types/react-router to dev dependencies
pull/2832/head^2
Andrew Watkins 2018-04-04 14:38:39 -07:00 committed by GitHub
commit 9e7a22c081
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 5 deletions

View File

@ -40,6 +40,7 @@
"@types/node": "^9.4.6", "@types/node": "^9.4.6",
"@types/prop-types": "^15.5.2", "@types/prop-types": "^15.5.2",
"@types/react": "^16.0.38", "@types/react": "^16.0.38",
"@types/react-router": "3",
"autoprefixer": "^6.3.1", "autoprefixer": "^6.3.1",
"babel-core": "^6.5.1", "babel-core": "^6.5.1",
"babel-eslint": "6.1.2", "babel-eslint": "6.1.2",

View File

@ -1,6 +1,7 @@
import React, {ReactElement, Component} from 'react' import React, {ReactElement, Component} from 'react'
import PropTypes from 'prop-types' 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 {connect} from 'react-redux'
import {bindActionCreators} from 'redux' import {bindActionCreators} from 'redux'
@ -32,12 +33,16 @@ interface State {
isFetching: boolean isFetching: boolean
} }
interface Params {
sourceID: string
}
interface Props { interface Props {
getSources: () => void getSources: () => void
sources: Source[] sources: Source[]
children: ReactElement<any> children: ReactElement<any>
params: Params params: Params
router: Router router: InjectedRouter
location: Location location: Location
auth: Auth auth: Auth
notify: () => void notify: () => void

View File

@ -1,5 +1,4 @@
import React, {PureComponent} from 'react' import React, {PureComponent} from 'react'
import {withRouter} from 'react-router'
import DataExplorer from './DataExplorer' import DataExplorer from './DataExplorer'
import {Source} from 'src/types' import {Source} from 'src/types'
@ -18,4 +17,4 @@ class DataExplorerPage extends PureComponent<Props> {
} }
} }
export default withRouter(DataExplorerPage) export default DataExplorerPage

View File

@ -7,7 +7,8 @@
"enzyme", "enzyme",
"react", "react",
"prop-types", "prop-types",
"jest" "jest",
"react-router"
], ],
"target": "es6", "target": "es6",
"module": "es2015", "module": "es2015",

View File

@ -41,6 +41,10 @@
"@types/cheerio" "*" "@types/cheerio" "*"
"@types/react" "*" "@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": "@types/jest@^22.1.4":
version "22.2.0" version "22.2.0"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-22.2.0.tgz#55ce83139f7ad1b48b414c3927746614c6963c0f" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-22.2.0.tgz#55ce83139f7ad1b48b414c3927746614c6963c0f"
@ -57,6 +61,13 @@
version "15.5.2" version "15.5.2"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.5.2.tgz#3c6b8dceb2906cc87fe4358e809f9d20c8d59be1" 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": "@types/react@*", "@types/react@^16.0.38":
version "16.0.40" version "16.0.40"
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.40.tgz#caabc2296886f40b67f6fc80f0f3464476461df9" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.40.tgz#caabc2296886f40b67f6fc80f0f3464476461df9"