@types/react 17.0.31 → 17.0.35

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 +9 -3
  3. 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: Thu, 21 Oct 2021 02:01:31 GMT
11
+ * Last updated: Mon, 15 Nov 2021 22:01:26 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
@@ -232,8 +232,11 @@ declare namespace React {
232
232
  type ReactText = string | number;
233
233
  type ReactChild = ReactElement | ReactText;
234
234
 
235
+ /**
236
+ * @deprecated Use either `ReactNode[]` if you need an array or `Iterable<ReactNode>` if its passed to a host component.
237
+ */
235
238
  interface ReactNodeArray extends ReadonlyArray<ReactNode> {}
236
- type ReactFragment = {} | ReactNodeArray;
239
+ type ReactFragment = {} | Iterable<ReactNode>;
237
240
  type ReactNode = ReactChild | ReactFragment | ReactPortal | boolean | null | undefined;
238
241
 
239
242
  //
@@ -392,9 +395,12 @@ declare namespace React {
392
395
  interface SuspenseProps {
393
396
  children?: ReactNode | undefined;
394
397
 
398
+ // TODO(react18): `fallback?: ReactNode;`
395
399
  /** A fallback react tree to show when a Suspense child (like React.lazy) suspends */
396
400
  fallback: NonNullable<ReactNode>|null;
397
401
  }
402
+
403
+ // TODO(react18): Updated JSDoc to reflect that Suspense works on the server.
398
404
  /**
399
405
  * This feature is not yet available for server-side rendering.
400
406
  * Suspense support will be added in a later release.
@@ -833,7 +839,7 @@ declare namespace React {
833
839
  ? JSX.IntrinsicElements[T]
834
840
  : {};
835
841
  type ComponentPropsWithRef<T extends ElementType> =
836
- T extends ComponentClass<infer P>
842
+ T extends (new (props: infer P) => Component<any, any>)
837
843
  ? PropsWithoutRef<P> & RefAttributes<InstanceType<T>>
838
844
  : PropsWithRef<ComponentProps<T>>;
839
845
  type ComponentPropsWithoutRef<T extends ElementType> =
@@ -1209,7 +1215,7 @@ declare namespace React {
1209
1215
  target: EventTarget & T;
1210
1216
  }
1211
1217
 
1212
- interface KeyboardEvent<T = Element> extends SyntheticEvent<T, NativeKeyboardEvent> {
1218
+ interface KeyboardEvent<T = Element> extends UIEvent<T, NativeKeyboardEvent> {
1213
1219
  altKey: boolean;
1214
1220
  /** @deprecated */
1215
1221
  charCode: number;
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "17.0.31",
3
+ "version": "17.0.35",
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": "46d24b70b081c9b0db6cb7755869ce75bd336d3e2004ccadc4bc9f9fd5037eba",
149
+ "typesPublisherContentHash": "cc91837b8e8126955f49bc8b3e6afbef0aa471bb70acff77bd4b1248170d686b",
150
150
  "typeScriptVersion": "3.7"
151
151
  }