@types/react 19.0.0 → 19.0.2

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 CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for react (https://react.dev/).
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, 05 Dec 2024 19:32:25 GMT
11
+ * Last updated: Wed, 18 Dec 2024 16:02:33 GMT
12
12
  * Dependencies: [csstype](https://npmjs.com/package/csstype)
13
13
 
14
14
  # Credits
react/index.d.ts CHANGED
@@ -132,7 +132,7 @@ declare namespace React {
132
132
  type JSXElementConstructor<P> =
133
133
  | ((
134
134
  props: P,
135
- ) => ReactNode)
135
+ ) => ReactNode | Promise<ReactNode>)
136
136
  // constructor signature must match React.Component
137
137
  | (new(props: P) => Component<any, any>);
138
138
 
@@ -1036,7 +1036,7 @@ declare namespace React {
1036
1036
  * ```
1037
1037
  */
1038
1038
  interface FunctionComponent<P = {}> {
1039
- (props: P): ReactNode;
1039
+ (props: P): ReactNode | Promise<ReactNode>;
1040
1040
  /**
1041
1041
  * Ignored by React.
1042
1042
  * @deprecated Only kept in types for backwards compatibility. Will be removed in a future major release.
@@ -1835,10 +1835,11 @@ declare namespace React {
1835
1835
  * A good example of this is a text input.
1836
1836
  *
1837
1837
  * @param value The value that is going to be deferred
1838
+ * @param initialValue A value to use during the initial render of a component. If this option is omitted, `useDeferredValue` will not defer during the initial render, because there’s no previous version of `value` that it can render instead.
1838
1839
  *
1839
1840
  * @see {@link https://react.dev/reference/react/useDeferredValue}
1840
1841
  */
1841
- export function useDeferredValue<T>(value: T): T;
1842
+ export function useDeferredValue<T>(value: T, initialValue?: T): T;
1842
1843
 
1843
1844
  /**
1844
1845
  * Allows components to avoid undesirable loading states by waiting for content to load
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "19.0.0",
3
+ "version": "19.0.2",
4
4
  "description": "TypeScript definitions for react",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
6
6
  "license": "MIT",
@@ -205,6 +205,6 @@
205
205
  "csstype": "^3.0.2"
206
206
  },
207
207
  "peerDependencies": {},
208
- "typesPublisherContentHash": "1253101b15ad6f61c7c90cbebe1db819d75a4879f84c016ff343827776b1cf2d",
208
+ "typesPublisherContentHash": "49591d334257359a89d9faf6b1929eb43b48a5e149f50204b56abcc5690a9bdf",
209
209
  "typeScriptVersion": "5.0"
210
210
  }
react/ts5.0/index.d.ts CHANGED
@@ -1834,10 +1834,11 @@ declare namespace React {
1834
1834
  * A good example of this is a text input.
1835
1835
  *
1836
1836
  * @param value The value that is going to be deferred
1837
+ * @param initialValue A value to use during the initial render of a component. If this option is omitted, `useDeferredValue` will not defer during the initial render, because there’s no previous version of `value` that it can render instead.
1837
1838
  *
1838
1839
  * @see {@link https://react.dev/reference/react/useDeferredValue}
1839
1840
  */
1840
- export function useDeferredValue<T>(value: T): T;
1841
+ export function useDeferredValue<T>(value: T, initialValue?: T): T;
1841
1842
 
1842
1843
  /**
1843
1844
  * Allows components to avoid undesirable loading states by waiting for content to load