Skip to content

Commit 05c9af5

Browse files
joshuaellismpeyper
andauthored
docs: update with suggestions
Co-authored-by: Michael Peyper <[email protected]>
1 parent c88c743 commit 05c9af5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

docs/api-reference.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ route: '/reference/api'
1919

2020
```ts
2121
function renderHook(
22-
callback: (props?: any): any,
22+
callback: (props?: any) => any,
2323
options?: RenderHookOptions
2424
): RenderHookResult
2525
```
@@ -103,9 +103,10 @@ function hydrate(): void
103103
> This is only used when using the `server` module. See [SSR](/usage/ssr-hooks) for more information
104104
> on server-side rendering your hooks.
105105

106-
A function to hydrate the component. This is required before you can interact with the hook, whether
107-
that is an `act` or `rerender` call. Some effects such as `useEffect` will not be called unless
108-
`hydrate` is called.
106+
A function to hydrate a server rendered component into the DOM. This is required before you can
107+
interact with the hook, whether that is an `act` or `rerender` call. Effects created using
108+
`useEffect` or `useLayoutEffect` are also not run on server rendered hooks until `hydrate` is
109+
called.
109110

110111
### `...asyncUtils`
111112

@@ -117,7 +118,7 @@ Utilities to assist with testing asynchronous behaviour. See the
117118
## `act`
118119

119120
This is the same [`act` function](https://reactjs.org/docs/test-utils.html#act) function that is
120-
exported from your chosen renderer. Although, they both work the same.
121+
exported from your [chosen renderer](/installation#renderer).
121122

122123
---
123124

@@ -157,7 +158,7 @@ module.exports = {
157158

158159
Alternatively, you can change your test to import from `@testing-library/react-hooks/pure` instead
159160
of the regular imports. This applys to any of our export methods documented in
160-
[Rendering](/rendering#being-specific).
161+
[Rendering](/installation#being-specific).
161162

162163
```diff
163164
- import { renderHook, cleanup, act } from '@testing-library/react-hooks'

0 commit comments

Comments
 (0)