Skip to content

Commit f343e59

Browse files
authored
Merge pull request #197 from kahwee/patch-1
Add { act } to be part of import
2 parents 28ee690 + 3889e23 commit f343e59

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/usage/advanced-hooks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function useCounter(initialValue = 0) {
3636
In our test, we simply use `CounterStepProvider` as the `wrapper` when rendering the hook:
3737

3838
```js
39-
import { renderHook } from '@testing-library/react-hooks'
39+
import { renderHook, act } from '@testing-library/react-hooks'
4040
import { CounterStepProvider, useCounter } from './counter'
4141

4242
test('should use custom step when incrementing', () => {
@@ -72,7 +72,7 @@ file:
7272
```js
7373
/* eslint-disable react/display-name */
7474

75-
import { renderHook } from '@testing-library/react-hooks'
75+
import { renderHook, act } from '@testing-library/react-hooks'
7676
import { CounterStepProvider, useCounter } from './counter'
7777

7878
test('should use custom step when incrementing', () => {
@@ -118,7 +118,7 @@ export function useCounter(initialValue = 0) {
118118
To test `incrementAsync` we need to `await waitForNextUpdate()` before the make our assertions:
119119

120120
```js
121-
import { renderHook, act } from '@testing-library/react-hooks'
121+
import { renderHook } from '@testing-library/react-hooks'
122122
import { useCounter } from './counter'
123123

124124
test('should increment counter after delay', async () => {

0 commit comments

Comments
 (0)