Skip to content

Commit ac096ab

Browse files
yinmeps1lon
andauthored
Add reactStrictMode option for RTL (#1318)
* docs: add `configure` functions and options for RTL * docs: change link for RTL's `configure` --------- Co-authored-by: Sebastian Silbermann <[email protected]>
1 parent 50ad2d2 commit ac096ab

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

docs/react-testing-library/api.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ as these methods:
3232
- [`result`](#result)
3333
- [`rerender`](#rerender-1)
3434
- [`unmount`](#unmount-1)
35+
- [`configure`](#configure)
36+
- [`configure` Options](#configure-options)
3537

3638
---
3739

@@ -451,3 +453,24 @@ const {unmount} = renderHook(({name = 'Alice'} = {}) => name)
451453

452454
unmount()
453455
```
456+
457+
## `configure`
458+
459+
Changes global options. Basic usage can be seen at
460+
[Configuration Options](dom-testing-library/api-configuration.mdx).
461+
462+
React Testing Library also has dedicated options.
463+
464+
```typescript
465+
import {configure} from '@testing-library/react'
466+
467+
configure({reactStrictMode: true})
468+
```
469+
470+
## `configure` Options
471+
472+
### `reactStrictMode`
473+
474+
When enabled, [`<StrictMode>`](https://react.dev/reference/react/StrictMode) is
475+
rendered around the inner element. Defaults to `false`.
476+

docs/react-testing-library/cheatsheet.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ See [Events API](dom-testing-library/api-events.mdx)
131131
## Other
132132

133133
See [Querying Within Elements](dom-testing-library/api-within.mdx),
134-
[Config API](dom-testing-library/api-configuration.mdx),
134+
[Config API](react-testing-library/api.mdx#configure),
135135
[Cleanup](react-testing-library/api.mdx#cleanup),
136136

137137
- **within** take a node and return an object with all the queries bound to the

0 commit comments

Comments
 (0)