From a6abfd23d433e48ebb47d62c904ac79fa629f4b2 Mon Sep 17 00:00:00 2001 From: eps1lon Date: Wed, 30 Mar 2022 17:13:24 +0200 Subject: [PATCH 1/2] docs: Add `render`#`legacyRoot` --- docs/react-testing-library/api.mdx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/react-testing-library/api.mdx b/docs/react-testing-library/api.mdx index 2180e5df0..68601ad87 100644 --- a/docs/react-testing-library/api.mdx +++ b/docs/react-testing-library/api.mdx @@ -11,6 +11,7 @@ as these methods: - [`container`](#container) - [`baseElement`](#baseelement) - [`hydrate`](#hydrate) + - [`legacyRoot`](#legacyroot) - [`wrapper`](#wrapper) - [`queries`](#queries) - [`render` Result](#render-result) @@ -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. + ### `wrapper` Pass a React Component as the `wrapper` option to have it rendered around the From 290a400ae522ea067b9807a23908afdcb6a69265 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 30 Mar 2022 19:44:39 +0200 Subject: [PATCH 2/2] Update docs/react-testing-library/api.mdx Co-authored-by: Matan Borenkraout --- docs/react-testing-library/api.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/react-testing-library/api.mdx b/docs/react-testing-library/api.mdx index 68601ad87..82c436563 100644 --- a/docs/react-testing-library/api.mdx +++ b/docs/react-testing-library/api.mdx @@ -102,7 +102,7 @@ By default we'll render with support for concurrent features (i.e. 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. +should enable this option by setting `legacyRoot: true`. ### `wrapper`