@types/react 17.0.18 → 17.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- react/README.md +1 -1
- react/index.d.ts +8 -0
- react/package.json +2 -2
react/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for React (http://facebook.github.io/reac
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Thu, 19 Aug 2021 05:01:20 GMT
|
12
12
|
* Dependencies: [@types/csstype](https://npmjs.com/package/@types/csstype), [@types/prop-types](https://npmjs.com/package/@types/prop-types), [@types/scheduler](https://npmjs.com/package/@types/scheduler)
|
13
13
|
* Global values: `React`
|
14
14
|
|
react/index.d.ts
CHANGED
@@ -840,6 +840,14 @@ declare namespace React {
|
|
840
840
|
type ComponentPropsWithoutRef<T extends ElementType> =
|
841
841
|
PropsWithoutRef<ComponentProps<T>>;
|
842
842
|
|
843
|
+
type ComponentRef<T extends ElementType> = T extends NamedExoticComponent<
|
844
|
+
ComponentPropsWithoutRef<T> & RefAttributes<infer Method>
|
845
|
+
>
|
846
|
+
? Method
|
847
|
+
: ComponentPropsWithRef<T> extends RefAttributes<infer Method>
|
848
|
+
? Method
|
849
|
+
: never;
|
850
|
+
|
843
851
|
// will show `Memo(${Component.displayName || Component.name})` in devtools by default,
|
844
852
|
// but can be given its own specific name
|
845
853
|
type MemoExoticComponent<T extends ComponentType<any>> = NamedExoticComponent<ComponentPropsWithRef<T>> & {
|
react/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react",
|
3
|
-
"version": "17.0.
|
3
|
+
"version": "17.0.19",
|
4
4
|
"description": "TypeScript definitions for React",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
|
6
6
|
"license": "MIT",
|
@@ -146,6 +146,6 @@
|
|
146
146
|
"@types/scheduler": "*",
|
147
147
|
"csstype": "^3.0.2"
|
148
148
|
},
|
149
|
-
"typesPublisherContentHash": "
|
149
|
+
"typesPublisherContentHash": "e16b27393628061b558b217cdf2b57016e3d83fcc9e6ba57ac7e0ebb1374826d",
|
150
150
|
"typeScriptVersion": "3.6"
|
151
151
|
}
|