mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 12:42:58 +08:00
Merge pull request #11215 from thegaryroberts/patch-1
Update react-router.d.ts
This commit is contained in:
4
react-router/react-router.d.ts
vendored
4
react-router/react-router.d.ts
vendored
@@ -39,10 +39,10 @@ declare namespace ReactRouter {
|
||||
type RouteComponent = Component
|
||||
|
||||
// use the following interface in an app code to get access to route param values, history, location...
|
||||
// interface MyComponentProps extends ReactRouter.RouteComponentProps<{}, { id: number }> {}
|
||||
// interface MyComponentProps extends ReactRouter.RouteComponentProps<{}, { id: string }> {}
|
||||
// somewhere in MyComponent
|
||||
// ...
|
||||
// let id = this.props.routeParams.id
|
||||
// let id = parseInt(this.props.routeParams.id, 10);
|
||||
// ...
|
||||
// this.props.history. ...
|
||||
// ...
|
||||
|
||||
Reference in New Issue
Block a user