mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
[React.14] Add ReactInstance type (Component<any, any> | Element)
This commit is contained in:
Vendored
+3
-8
@@ -112,6 +112,8 @@ declare namespace __React {
|
||||
// Component API
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
type ReactInstance = Component<any, any> | Element;
|
||||
|
||||
// Base component for plain JS classes
|
||||
class Component<P, S> implements ComponentLifecycle<P, S> {
|
||||
static propTypes: ValidationMap<any>;
|
||||
@@ -128,7 +130,7 @@ declare namespace __React {
|
||||
state: S;
|
||||
context: {};
|
||||
refs: {
|
||||
[key: string]: Component<any, any> | Element
|
||||
[key: string]: ReactInstance
|
||||
};
|
||||
}
|
||||
|
||||
@@ -138,13 +140,6 @@ declare namespace __React {
|
||||
getInitialState?(): S;
|
||||
}
|
||||
|
||||
interface DOMComponent<P> extends ClassicComponent<P, any> {
|
||||
tagName: string;
|
||||
}
|
||||
|
||||
type HTMLComponent = DOMComponent<HTMLProps>;
|
||||
type SVGComponent = DOMComponent<SVGProps>;
|
||||
|
||||
interface ChildContextProvider<CC> {
|
||||
getChildContext(): CC;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user