diff --git a/.all-contributorsrc b/.all-contributorsrc index 94a4f3fb..06c7cb58 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -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" diff --git a/README.md b/README.md index 713869b1..c7df1f10 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Sarah Dayan

📦 +
Roman Gusev

📖 diff --git a/docs/api-reference.md b/docs/api-reference.md index 1bb02705..72abd096 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -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` diff --git a/docs/usage/advanced-hooks.md b/docs/usage/advanced-hooks.md index 2a5671bc..d016452e 100644 --- a/docs/usage/advanced-hooks.md +++ b/docs/usage/advanced-hooks.md @@ -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` @@ -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. diff --git a/docs/usage/basic-hooks.md b/docs/usage/basic-hooks.md index 5b8d13cb..f3860c84 100644 --- a/docs/usage/basic-hooks.md +++ b/docs/usage/basic-hooks.md @@ -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: