react: use more narrow constructor definition (#13769)

This has almost no sense for typescript, but very useful for ide.
At least webstorm uses first constructor definition with `Generate constructor action`.
And, I think it is good to define more narrow method definition earlier that more general.
This commit is contained in:
Artur Eshenbrener
2017-01-06 17:52:41 +03:00
committed by Andy
parent d6397a9075
commit 95dd4d0417

2
react/index.d.ts vendored
View File

@@ -163,8 +163,8 @@ declare namespace React {
// Base component for plain JS classes
class Component<P, S> implements ComponentLifecycle<P, S> {
constructor(...args: any[]);
constructor(props?: P, context?: any);
constructor(...args: any[]);
setState(f: (prevState: S, props: P) => S, callback?: () => any): void;
setState(state: S, callback?: () => any): void;
forceUpdate(callBack?: () => any): void;