Skip to content

Commit

Permalink
use @types/react-router-dom type definition (#1519)
Browse files Browse the repository at this point in the history
  • Loading branch information
Frezc authored and sorrycc committed Nov 26, 2018
1 parent 08da2e3 commit 41469fb
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 57 deletions.
18 changes: 1 addition & 17 deletions packages/umi/link.d.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
import * as React from 'react';

declare class Link extends React.Component<{
to: string | {
pathname: string,
search?: string,
hash?: string,
state?: any,
},
replace?: boolean,
innerRef?: Function,
title?: string,
id?: string,
className?: string,
}, any> {
render(): JSX.Element;
}
import { Link } from 'react-router-dom';
export default Link;
24 changes: 1 addition & 23 deletions packages/umi/navlink.d.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,2 @@
import * as React from 'react';

declare class NavLink extends React.Component<{
to: string | {
pathname: string,
search: string,
hash: string,
state: any,
},
replace?: boolean,
innerRef?: Function,
title?: string,
id?: string,
className?: string,
activeClassName?: string,
activeStyle?: object,
exact?: boolean,
strict?: boolean,
isActive?: Function,
location?: object,
}, any> {
render(): JSX.Element;
}
import { NavLink } from 'react-router-dom';
export default NavLink;
1 change: 1 addition & 0 deletions packages/umi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"@babel/core": "^7.0.0",
"@babel/runtime": "^7.0.0",
"@types/react": "^16.4.9",
"@types/react-router-dom": "4.x",
"babel-preset-umi": "^1.2.1",
"debug": "^3.1.0",
"dotenv": "^6.0.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/umi/prompt.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { Prompt } from 'react-router-dom';
export default Prompt;
17 changes: 1 addition & 16 deletions packages/umi/redirect.d.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,2 @@
import * as React from 'react';

declare class Redirect extends React.Component<{
to: string | {
pathname: string,
search: string,
hash: string,
state: any,
},
push?: boolean,
from?: string,
exact?: boolean,
strict?: boolean,
}, any> {
render(): JSX.Element;
}
import { Redirect } from 'react-router-dom';
export default Redirect;
2 changes: 1 addition & 1 deletion packages/umi/withRouter.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
declare const withRouter: (component:Function) => Function;
import { withRouter } from 'react-router-dom';
export default withRouter;

0 comments on commit 41469fb

Please sign in to comment.