-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
TypeScript Version: 2.5.3
Code
class MyComponent extends React.Component<{}, {}> {
render () {
return null
}
}
function thisTakesAComponent (component: typeof React.Component) {
}
thisTakesAComponent(MyComponent)
Expected behavior:
Should compile fine.
Actual behavior:
Argument of type 'typeof MyComponent' is not assignable to parameter of type 'typeof Component'.
Type 'MyComponent' is not assignable to type 'Component<P, S>'.
Types of property 'setState' are incompatible.
Type '{ <K extends never>(f: (prevState: {}, props: {}) => Pick<{}, K>, callback?: (() => any) | undefi...' is not assignable to type '{ <K extends keyof S>(f: (prevState: S, props: P) => Pick<S, K>, callback?: (() => any) | undefin...'.
Types of parameters 'f' and 'f' are incompatible.
Types of parameters 'prevState' and 'prevState' are incompatible.
Type '{}' is not assignable to type 'S'.
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug