@types/react-dom 18.0.2 → 18.0.5

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 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: Thu, 21 Apr 2022 18:01:42 GMT
11
+ * Last updated: Mon, 23 May 2022 19:01:40 GMT
12
12
  * Dependencies: [@types/react](https://npmjs.com/package/@types/react)
13
13
  * Global values: `ReactDOM`, `ReactDOMServer`
14
14
 
react-dom/client.d.ts CHANGED
@@ -22,7 +22,7 @@ export interface RootOptions {
22
22
  }
23
23
 
24
24
  export interface Root {
25
- render(children: React.ReactChild | Iterable<React.ReactNode>): void;
25
+ render(children: React.ReactNode): void;
26
26
  unmount(): void;
27
27
  }
28
28
 
@@ -33,8 +33,21 @@ export interface Root {
33
33
  */
34
34
  export function createRoot(container: Element | DocumentFragment, options?: RootOptions): Root;
35
35
 
36
+ /**
37
+ * Same as `createRoot()`, but is used to hydrate a container whose HTML contents were rendered by ReactDOMServer.
38
+ *
39
+ * React will attempt to attach event listeners to the existing markup.
40
+ *
41
+ * **Example Usage**
42
+ *
43
+ * ```jsx
44
+ * hydrateRoot(document.querySelector('#root'), <App />)
45
+ * ```
46
+ *
47
+ * @see https://reactjs.org/docs/react-dom-client.html#hydrateroot
48
+ */
36
49
  export function hydrateRoot(
37
50
  container: Element | Document,
38
- initialChildren: React.ReactChild | Iterable<React.ReactNode>,
51
+ initialChildren: React.ReactNode,
39
52
  options?: HydrationOptions,
40
53
  ): Root;
react-dom/index.d.ts CHANGED
@@ -25,7 +25,7 @@ import {
25
25
  export function findDOMNode(instance: ReactInstance | null | undefined): Element | null | Text;
26
26
  export function unmountComponentAtNode(container: Element | DocumentFragment): boolean;
27
27
 
28
- export function createPortal(children: ReactNode, container: Element, key?: null | string): ReactPortal;
28
+ export function createPortal(children: ReactNode, container: Element | DocumentFragment, key?: null | string): ReactPortal;
29
29
 
30
30
  export const version: string;
31
31
  export const render: Renderer;
react-dom/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react-dom",
3
- "version": "18.0.2",
3
+ "version": "18.0.5",
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,7 +49,7 @@
49
49
  "dependencies": {
50
50
  "@types/react": "*"
51
51
  },
52
- "typesPublisherContentHash": "72a20209680e5c96e111d54d943c23ee84ae698daf720273739b5f72b1f276a1",
52
+ "typesPublisherContentHash": "4732472d5e01f7ef46a8073630a67b5623c0afe2b37ffe340d0ce7a650274749",
53
53
  "typeScriptVersion": "3.9",
54
54
  "exports": {
55
55
  ".": {
react-dom/server.d.ts CHANGED
@@ -58,7 +58,7 @@ export function renderToPipeableStream(children: ReactNode, options?: RenderToPi
58
58
  * and send the markup down on the initial request for faster page loads and to allow search
59
59
  * engines to crawl your pages for SEO purposes.
60
60
  *
61
- * If you call `ReactDOM.hydrate()` on a node that already has this server-rendered markup,
61
+ * If you call `ReactDOMClient.hydrateRoot()` on a node that already has this server-rendered markup,
62
62
  * React will preserve it and only attach event handlers, allowing you
63
63
  * to have a very performant first-load experience.
64
64
  */