Skip to content

Fix typos #378

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 1 commit into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@
"contributions": [
"platform"
]
},
{
"login": "102",
"name": "Roman Gusev",
"avatar_url": "https://avatars1.githubusercontent.com/u/5839225?v=4",
"profile": "https://github.com/102",
"contributions": [
"doc"
]
}
],
"commitConvention": "none"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
</tr>
<tr>
<td align="center"><a href="http://frontstuff.io"><img src="https://avatars1.githubusercontent.com/u/5370675?v=4" width="100px;" alt=""/><br /><sub><b>Sarah Dayan</b></sub></a><br /><a href="#platform-sarahdayan" title="Packaging/porting to new platform">📦</a></td>
<td align="center"><a href="https://github.com/102"><img src="https://avatars1.githubusercontent.com/u/5839225?v=4" width="100px;" alt=""/><br /><sub><b>Roman Gusev</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=102" title="Documentation">📖</a></td>
</tr>
</table>

Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ See the [`wait` Options](/reference/api#wait-options) section for more details o

### `wait` Options

The async utilities accepts the following options:
The async utilities accept the following options:

#### `timeout`

Expand Down
14 changes: 7 additions & 7 deletions docs/usage/advanced-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ you, your team, and your project.
## Async

Sometimes, a hook can trigger asynchronous updates that will not be immediately reflected in the
`result.current` value. Luckily, `renderHook` returns some utilities that allows the test to wait
for the hook to update using `async/await` (or just promise callbacks if you prefer). The most basic
`result.current` value. Luckily, `renderHook` returns some utilities that allow the test to wait for
the hook to update using `async/await` (or just promise callbacks if you prefer). The most basic
async utility is called `waitForNextUpdate`.

Let's further extend `useCounter` to have an `incrementAsync` callback that will update the `count`
Expand Down Expand Up @@ -132,16 +132,16 @@ test('should increment counter after delay', async () => {
})
```

Wrapping `incrementAsync` in `act()` is not necessary since the state updates happen
asynchronously during `await waitForNextUpdate()`. The async utilities automatically wrap the
waiting code in the asynchronous `act()` wrapper.
Wrapping `incrementAsync` in `act()` is not necessary since the state updates happen asynchronously
during `await waitForNextUpdate()`. The async utilities automatically wrap the waiting code in the
asynchronous `act()` wrapper.

For more details on the the other async utilities, please refer to the
For more details on the other async utilities, please refer to the
[API Reference](/reference/api#asyncutils).

### Suspense

All the [async utilities](/reference/api#async-utilities) will also wait for hooks that suspends
All the [async utilities](/reference/api#async-utilities) will also wait for hooks that suspend
using [React's `Suspense`](https://reactjs.org/docs/react-api.html#reactsuspense) functionality to
complete rendering.

Expand Down
2 changes: 1 addition & 1 deletion docs/usage/basic-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ test('should reset counter to updated initial value', () => {
})
```

Another case where this is useful is when you want limit the scope of the variables being closed
Another case where this is useful is when you want to limit the scope of the variables being closed
over to just be inside the hook callback. The following (contrived) example fails because the `id`
value changes for both the setup and cleanup of the `useEffect` call:

Expand Down