Skip to content

Commit

Permalink
Skip ComponentType test which only fails starting with 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Sep 18, 2019
1 parent 47cb153 commit 1a03f8f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions types/react-router/test/WithRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ const FunctionComponent: React.FunctionComponent<TOwnProps> = props => (
<h2>Welcome {props.username}</h2>
);

declare const Component: React.ComponentType<TOwnProps>;

class ComponentClass extends React.Component<TOwnProps> {
render() {
return <h2>Welcome {this.props.username}</h2>;
Expand All @@ -23,10 +21,15 @@ class ComponentClass extends React.Component<TOwnProps> {

const WithRouterComponentFunction = withRouter(ComponentFunction);
const WithRouterFunctionComponent = withRouter(FunctionComponent);
const WithRouterComponent = withRouter(Component);
const WithRouterComponentClass = withRouter(ComponentClass);
WithRouterComponentClass.WrappedComponent; // $ExpectType typeof ComponentClass

// Fix introduced in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/38326
// caused more common use cases with `strictFunctionTypes` to fail
// declare const Component: React.ComponentType<TOwnProps>;
// $ExpectError ^3.6.3
// const WithRouterComponent = withRouter(Component);

const WithRouterTestFunction = () => (
<WithRouterComponentFunction username="John" />
);
Expand Down

0 comments on commit 1a03f8f

Please sign in to comment.