From aa6cbcadd49060b53a265384931f1e3d8e7c9293 Mon Sep 17 00:00:00 2001 From: yinm Date: Sun, 8 Oct 2023 23:26:47 +0900 Subject: [PATCH 1/2] docs: add `configure` functions and options for RTL --- docs/react-testing-library/api.mdx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/react-testing-library/api.mdx b/docs/react-testing-library/api.mdx index 4b1876dc7..a68864328 100644 --- a/docs/react-testing-library/api.mdx +++ b/docs/react-testing-library/api.mdx @@ -31,6 +31,8 @@ as these methods: - [`renderHook` Result](#renderhook-result) - [`result`](#result) - [`rerender`](#rerender-1) +- [`configure`](#configure) +- [`configure` Options](#configure-options) --- @@ -431,3 +433,23 @@ const {rerender} = renderHook(({name = 'Alice'} = {}) => name) // re-render the same hook with different props rerender({name: 'Bob'}) ``` + +## `configure` + +Changes global options. Basic usage can be seen at +[Configuration Options](dom-testing-library/api-configuration.mdx). + +React Testing Library also has dedicated options. + +```typescript +import {configure} from '@testing-library/react' + +configure({reactStrictMode: true}) +``` + +## `configure` Options + +### `reactStrictMode` + +When enabled, [``](https://react.dev/reference/react/StrictMode) is +rendered around the inner element. Defaults to `false`. From 48f3b1fe8b6555e76b189e851dc40cebe333e104 Mon Sep 17 00:00:00 2001 From: yinm Date: Sun, 8 Oct 2023 23:30:51 +0900 Subject: [PATCH 2/2] docs: change link for RTL's `configure` --- docs/react-testing-library/cheatsheet.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/react-testing-library/cheatsheet.mdx b/docs/react-testing-library/cheatsheet.mdx index d0e3341be..53da683d3 100644 --- a/docs/react-testing-library/cheatsheet.mdx +++ b/docs/react-testing-library/cheatsheet.mdx @@ -131,7 +131,7 @@ See [Events API](dom-testing-library/api-events.mdx) ## Other See [Querying Within Elements](dom-testing-library/api-within.mdx), -[Config API](dom-testing-library/api-configuration.mdx), +[Config API](react-testing-library/api.mdx#configure), [Cleanup](react-testing-library/api.mdx#cleanup), - **within** take a node and return an object with all the queries bound to the