Skip to content

Commit aa6cbca

Browse files
committed
docs: add configure functions and options for RTL
1 parent 22cf9b4 commit aa6cbca

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/react-testing-library/api.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ as these methods:
3131
- [`renderHook` Result](#renderhook-result)
3232
- [`result`](#result)
3333
- [`rerender`](#rerender-1)
34+
- [`configure`](#configure)
35+
- [`configure` Options](#configure-options)
3436

3537
---
3638

@@ -431,3 +433,23 @@ const {rerender} = renderHook(({name = 'Alice'} = {}) => name)
431433
// re-render the same hook with different props
432434
rerender({name: 'Bob'})
433435
```
436+
437+
## `configure`
438+
439+
Changes global options. Basic usage can be seen at
440+
[Configuration Options](dom-testing-library/api-configuration.mdx).
441+
442+
React Testing Library also has dedicated options.
443+
444+
```typescript
445+
import {configure} from '@testing-library/react'
446+
447+
configure({reactStrictMode: true})
448+
```
449+
450+
## `configure` Options
451+
452+
### `reactStrictMode`
453+
454+
When enabled, [`<StrictMode>`](https://react.dev/reference/react/StrictMode) is
455+
rendered around the inner element. Defaults to `false`.

0 commit comments

Comments
 (0)