Skip to content

Add reactStrictMode option for RTL #1318

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

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Merge branch 'main' into pr/add-reactStrictMode-option
  • Loading branch information
eps1lon authored Jan 30, 2024
commit e2783d1c99fe7df2783a71e9cad536ce93678a7c
14 changes: 14 additions & 0 deletions docs/react-testing-library/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ as these methods:
- [`renderHook` Result](#renderhook-result)
- [`result`](#result)
- [`rerender`](#rerender-1)
- [`unmount`](#unmount-1)
- [`configure`](#configure)
- [`configure` Options](#configure-options)

Expand Down Expand Up @@ -441,6 +442,18 @@ const {rerender} = renderHook(({name = 'Alice'} = {}) => name)
rerender({name: 'Bob'})
```

### `unmount`

Unmounts the test hook.

```jsx
import {renderHook} from '@testing-library/react'

const {unmount} = renderHook(({name = 'Alice'} = {}) => name)

unmount()
```

## `configure`

Changes global options. Basic usage can be seen at
Expand All @@ -460,3 +473,4 @@ configure({reactStrictMode: true})

When enabled, [`<StrictMode>`](https://react.dev/reference/react/StrictMode) is
rendered around the inner element. Defaults to `false`.

You are viewing a condensed version of this merge commit. You can view the full changes here.