mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +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:
Vendored
+1
@@ -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