Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add render#legacyRoot #1034

Merged
merged 2 commits into from
Mar 31, 2022
Merged
Changes from all 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
10 changes: 10 additions & 0 deletions docs/react-testing-library/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ as these methods:
- [`container`](#container)
- [`baseElement`](#baseelement)
- [`hydrate`](#hydrate)
- [`legacyRoot`](#legacyroot)
- [`wrapper`](#wrapper)
- [`queries`](#queries)
- [`render` Result](#render-result)
Expand Down Expand Up @@ -94,6 +95,15 @@ If hydrate is set to true, then it will render with
useful if you are using server-side rendering and use ReactDOM.hydrate to mount
your components.

### `legacyRoot`

By default we'll render with support for concurrent features (i.e.
[`ReactDOMClient.createRoot`](https://reactjs.org/docs/react-dom-client.html#createroot)).
However, if you're dealing with a legacy app that requires rendering like in
React 17 (i.e.
[`ReactDOM.render`](https://reactjs.org/docs/react-dom.html#render)) then you
should enable this option by setting `legacyRoot: true`.

### `wrapper`

Pass a React Component as the `wrapper` option to have it rendered around the
Expand Down