@types/react-dom 17.0.9 → 17.0.12
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-dom/README.md +1 -1
- react-dom/index.d.ts +2 -2
- react-dom/next.d.ts +14 -8
- react-dom/package.json +3 -3
- react-dom/test-utils/index.d.ts +3 -3
react-dom/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for React (react-dom) (https://reactjs.or
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Tue, 01 Mar 2022 21:01:57 GMT
|
12
12
|
* Dependencies: [@types/react](https://npmjs.com/package/@types/react)
|
13
13
|
* Global values: `ReactDOM`, `ReactDOMNodeStream`, `ReactDOMServer`
|
14
14
|
|
react-dom/index.d.ts
CHANGED
@@ -22,7 +22,7 @@ export as namespace ReactDOM;
|
|
22
22
|
|
23
23
|
import {
|
24
24
|
ReactInstance, Component, ComponentState,
|
25
|
-
ReactElement,
|
25
|
+
ReactElement, FunctionComponentElement, CElement,
|
26
26
|
DOMAttributes, DOMElement, ReactNode, ReactPortal
|
27
27
|
} from 'react';
|
28
28
|
|
@@ -77,7 +77,7 @@ export interface Renderer {
|
|
77
77
|
): Element;
|
78
78
|
|
79
79
|
(
|
80
|
-
element:
|
80
|
+
element: FunctionComponentElement<any> | Array<FunctionComponentElement<any>>,
|
81
81
|
container: Container| null,
|
82
82
|
callback?: () => void
|
83
83
|
): void;
|
react-dom/next.d.ts
CHANGED
@@ -34,21 +34,23 @@ declare module '.' {
|
|
34
34
|
interface HydrationOptions {
|
35
35
|
onHydrated?(suspenseInstance: Comment): void;
|
36
36
|
onDeleted?(suspenseInstance: Comment): void;
|
37
|
+
/**
|
38
|
+
* Prefix for `useId`.
|
39
|
+
*/
|
40
|
+
identifierPrefix?: string;
|
41
|
+
onRecoverableError?: (error: unknown) => void;
|
37
42
|
}
|
38
43
|
|
39
44
|
interface RootOptions {
|
40
45
|
/**
|
41
|
-
*
|
42
|
-
*/
|
43
|
-
hydrate?: boolean | undefined;
|
44
|
-
/**
|
45
|
-
* @deprecated Use `hydrateRoot(container, hydrateOptions)` instead
|
46
|
+
* Prefix for `useId`.
|
46
47
|
*/
|
47
|
-
|
48
|
+
identifierPrefix?: string;
|
49
|
+
onRecoverableError?: (error: unknown) => void;
|
48
50
|
}
|
49
51
|
|
50
52
|
interface Root {
|
51
|
-
render(children: React.ReactChild | React.
|
53
|
+
render(children: React.ReactChild | Iterable<React.ReactNode>): void;
|
52
54
|
unmount(): void;
|
53
55
|
}
|
54
56
|
|
@@ -59,5 +61,9 @@ declare module '.' {
|
|
59
61
|
*/
|
60
62
|
function createRoot(container: Element | Document | DocumentFragment | Comment, options?: RootOptions): Root;
|
61
63
|
|
62
|
-
function hydrateRoot(
|
64
|
+
function hydrateRoot(
|
65
|
+
container: Element | Document | DocumentFragment | Comment,
|
66
|
+
initialChildren: React.ReactChild | Iterable<React.ReactNode>,
|
67
|
+
options?: HydrationOptions,
|
68
|
+
): Root;
|
63
69
|
}
|
react-dom/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react-dom",
|
3
|
-
"version": "17.0.
|
3
|
+
"version": "17.0.12",
|
4
4
|
"description": "TypeScript definitions for React (react-dom)",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom",
|
6
6
|
"license": "MIT",
|
@@ -49,6 +49,6 @@
|
|
49
49
|
"dependencies": {
|
50
50
|
"@types/react": "*"
|
51
51
|
},
|
52
|
-
"typesPublisherContentHash": "
|
53
|
-
"typeScriptVersion": "3.
|
52
|
+
"typesPublisherContentHash": "fc946accda3e64332162436943cb68c5ac37f9e9bff0c3b25bf706e0e5ab2b4a",
|
53
|
+
"typeScriptVersion": "3.9"
|
54
54
|
}
|
react-dom/test-utils/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import {
|
2
2
|
AbstractView, Component, ComponentClass,
|
3
3
|
ReactElement, ReactInstance, ClassType,
|
4
|
-
DOMElement,
|
4
|
+
DOMElement, FunctionComponentElement, CElement,
|
5
5
|
ReactHTMLElement, DOMAttributes, SFC
|
6
6
|
} from 'react';
|
7
7
|
|
@@ -157,7 +157,7 @@ export namespace Simulate {
|
|
157
157
|
export function renderIntoDocument<T extends Element>(
|
158
158
|
element: DOMElement<any, T>): T;
|
159
159
|
export function renderIntoDocument(
|
160
|
-
element:
|
160
|
+
element: FunctionComponentElement<any>): void;
|
161
161
|
// If we replace `P` with `any` in this overload, then some tests fail because
|
162
162
|
// calls to `renderIntoDocument` choose the last overload on the
|
163
163
|
// subtype-relation pass and get an undesirably broad return type. Using `P`
|
@@ -194,7 +194,7 @@ export function isElementOfType<P extends DOMAttributes<{}>, T extends Element>(
|
|
194
194
|
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
195
195
|
*/
|
196
196
|
export function isElementOfType<P>(
|
197
|
-
element: ReactElement, type: SFC<P>): element is
|
197
|
+
element: ReactElement, type: SFC<P>): element is FunctionComponentElement<P>;
|
198
198
|
/**
|
199
199
|
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
200
200
|
*/
|