Update index.d.ts

Fixing compile errors that needs a a value for the generic State property in React.Component<Props, State>
This commit is contained in:
atothek1 2017-06-30 08:45:06 +02:00 committed by GitHub
parent 00222e6b0a
commit da620a35a3

View File

@ -15,7 +15,7 @@ import { ReactElement, Component, HTMLAttributes as ReactHTMLAttributes, SVGAttr
export type HTMLAttributes = ReactHTMLAttributes<{}> & ReactSVGAttributes<{}>;
export class ElementClass extends Component<any> {
export class ElementClass extends Component<any, any> {
}
/* These are purposefully stripped down versions of React.ComponentClass and React.StatelessComponent.
@ -23,7 +23,7 @@ export class ElementClass extends Component<any> {
* all specified in the implementation. TS chooses the EnzymePropSelector overload and loses the generics
*/
export interface ComponentClass<Props> {
new (props?: Props, context?: any): Component<Props>;
new (props?: Props, context?: any): Component<Props, any>;
}
export type StatelessComponent<Props> = (props: Props, context?: any) => JSX.Element;