@@ -95,8 +95,8 @@ you, your team, and your project.
95
95
## Async
96
96
97
97
Sometimes, a hook can trigger asynchronous updates that will not be immediately reflected in the
98
- ` result.current ` value. Luckily, ` renderHook ` returns some utilities that allows the test to wait
99
- for the hook to update using ` async/await ` (or just promise callbacks if you prefer). The most basic
98
+ ` result.current ` value. Luckily, ` renderHook ` returns some utilities that allow the test to wait for
99
+ the hook to update using ` async/await ` (or just promise callbacks if you prefer). The most basic
100
100
async utility is called ` waitForNextUpdate ` .
101
101
102
102
Let's further extend ` useCounter ` to have an ` incrementAsync ` callback that will update the ` count `
@@ -132,16 +132,16 @@ test('should increment counter after delay', async () => {
132
132
})
133
133
```
134
134
135
- Wrapping ` incrementAsync ` in ` act() ` is not necessary since the state updates happen
136
- asynchronously during ` await waitForNextUpdate() ` . The async utilities automatically wrap the
137
- waiting code in the asynchronous ` act() ` wrapper.
135
+ Wrapping ` incrementAsync ` in ` act() ` is not necessary since the state updates happen asynchronously
136
+ during ` await waitForNextUpdate() ` . The async utilities automatically wrap the waiting code in the
137
+ asynchronous ` act() ` wrapper.
138
138
139
- For more details on the the other async utilities, please refer to the
139
+ For more details on the other async utilities, please refer to the
140
140
[ API Reference] ( /reference/api#asyncutils ) .
141
141
142
142
### Suspense
143
143
144
- All the [ async utilities] ( /reference/api#async-utilities ) will also wait for hooks that suspends
144
+ All the [ async utilities] ( /reference/api#async-utilities ) will also wait for hooks that suspend
145
145
using [ React's ` Suspense ` ] ( https://reactjs.org/docs/react-api.html#reactsuspense ) functionality to
146
146
complete rendering.
147
147
0 commit comments