Allow pass ComponentClass state to StaticLifecycle (#27417)

* Update index.d.ts

* set default state to empty object

* use S instead ComponentState

* defaults to ComponentState
This commit is contained in:
pravdomil
2018-07-23 20:40:00 +02:00
committed by Andy
parent 642a64efbf
commit 09468a17a1

View File

@@ -354,8 +354,8 @@ declare namespace React {
displayName?: string;
}
interface ComponentClass<P = {}> extends StaticLifecycle<P, any> {
new (props: P, context?: any): Component<P, ComponentState>;
interface ComponentClass<P = {}, S = ComponentState> extends StaticLifecycle<P, S> {
new (props: P, context?: any): Component<P, S>;
propTypes?: ValidationMap<P>;
contextTypes?: ValidationMap<any>;
childContextTypes?: ValidationMap<any>;