mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Add Component<P> class
This allows declaring a parameter or variable as a general "component with props P" instead of needing to declare it class based or function.
This commit is contained in:
1
types/react/index.d.ts
vendored
1
types/react/index.d.ts
vendored
@@ -26,6 +26,7 @@ declare namespace React {
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
type ReactType = string | ComponentClass<any> | StatelessComponent<any>;
|
||||
type Component<P> = ComponentClass<P> | StatelessComponent<P>;
|
||||
|
||||
type Key = string | number;
|
||||
type Ref<T> = string | ((instance: T) => any);
|
||||
|
||||
Reference in New Issue
Block a user