Skip to content

Commit

Permalink
Revert implementation of DefinitelyTyped#38326
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Sep 18, 2019
1 parent 4a360c9 commit 47cb153
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions types/react-router/index.d.ts
Expand Up @@ -143,12 +143,8 @@ export interface WithRouterStatics<C extends React.ComponentType<any>> {
// they are decorating. Due to this, if you are using @withRouter decorator in your code,
// you will see a bunch of errors from TypeScript. The current workaround is to use withRouter() as a function call
// on a separate line instead of as a decorator.
export function withRouter<C extends React.ComponentType<RouteComponentProps>>(
component: C,
): React.ComponentClass<
Omit<React.ComponentProps<C>, keyof RouteComponentProps> & WithRouterProps<C>,
never
> &
WithRouterStatics<C>;
export function withRouter<P extends RouteComponentProps<any>, C extends React.ComponentType<P>>(
component: C & React.ComponentType<P>,
): React.ComponentClass<Omit<P, keyof RouteComponentProps<any>> & WithRouterProps<C>> & WithRouterStatics<C>;

export const __RouterContext: React.Context<RouteComponentProps>;

0 comments on commit 47cb153

Please sign in to comment.