mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
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:
2
react/index.d.ts
vendored
2
react/index.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user