Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion content/docs/reference-react-dom.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The `react-dom` package also provides modules specific to client and server apps

The `react-dom` package exports these methods:
- [`createPortal()`](#createportal)

- [`flushSync()`](#flushsync)

These `react-dom` methods are also exported, but are considered legacy:
- [`render()`](#render)
Expand Down Expand Up @@ -55,6 +55,23 @@ createPortal(child, container)
```

Creates a portal. Portals provide a way to [render children into a DOM node that exists outside the hierarchy of the DOM component](/docs/portals.html).

### `flushSync()` {#flushsync}

```javascript
flushSync(callback)
```

Force React to flush any updates inside the provided callback synchronously. This method is useful for being able to read the result of those updates immediately.

> Note:
>
> `flushSync` can have a significant impact on performance. Use sparingly.
>
> `flushSync` will force Suspense boundaries to show their `fallback` state.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*can ... if they're still loading.

>
> `flushSync` may also run pending effects and synchronously apply any updates they contain before returning.

## Legacy Reference
### `render()` {#render}
```javascript
Expand Down