@types/react 16.9.35 → 16.9.36

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.
Files changed (3) hide show
  1. react/README.md +1 -1
  2. react/index.d.ts +10 -13
  3. react/package.json +3 -3
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: Mon, 11 May 2020 01:27:17 GMT
11
+ * Last updated: Wed, 10 Jun 2020 09:08:56 GMT
12
12
  * Dependencies: [@types/csstype](https://npmjs.com/package/@types/csstype), [@types/prop-types](https://npmjs.com/package/@types/prop-types)
13
13
  * Global values: `React`
14
14
 
react/index.d.ts CHANGED
@@ -113,19 +113,16 @@ declare namespace React {
113
113
  | { new (props: any): Component<any> }
114
114
  | ((props: any, context?: any) => ReactElement | null)
115
115
  | keyof JSX.IntrinsicElements
116
- > = C extends ForwardRefExoticComponent<infer FP>
117
- ? FP extends RefAttributes<infer FC>
118
- ? FC
119
- : never
120
- : C extends { new (props: any): Component<any> }
121
- ? InstanceType<C>
122
- : C extends ((props: any, context?: any) => ReactElement | null)
123
- ? undefined
124
- : C extends keyof JSX.IntrinsicElements
125
- ? JSX.IntrinsicElements[C] extends DOMAttributes<infer E>
126
- ? E
127
- : never
128
- : never;
116
+ > =
117
+ // need to check first if `ref` is a valid prop for ts@3.0
118
+ // otherwise it will infer `{}` instead of `never`
119
+ "ref" extends keyof ComponentPropsWithRef<C>
120
+ ? NonNullable<ComponentPropsWithRef<C>["ref"]> extends Ref<
121
+ infer Instance
122
+ >
123
+ ? Instance
124
+ : never
125
+ : never;
129
126
 
130
127
  type ComponentState = any;
131
128
 
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "16.9.35",
3
+ "version": "16.9.36",
4
4
  "description": "TypeScript definitions for React",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -139,6 +139,6 @@
139
139
  "@types/prop-types": "*",
140
140
  "csstype": "^2.2.0"
141
141
  },
142
- "typesPublisherContentHash": "46ea77d3338a7e56a61d910e9a5f41ddb38ab6b52387aa8ac9bea893f697041f",
143
- "typeScriptVersion": "2.9"
142
+ "typesPublisherContentHash": "a9a771c9ca1959d5f2d2aad48302b48ee78d517dcbe73e31674304f9ed986e0f",
143
+ "typeScriptVersion": "3.0"
144
144
  }