Skip to content

Commit 3091bf9

Browse files
committed
Merge branch 'result-history' of https://github.com/testing-library/react-hooks-testing-library into result-history
2 parents 8090d1a + b59e242 commit 3091bf9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/api-reference.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,17 @@ The `renderHook` function returns an object that has the following properties:
6363

6464
```js
6565
{
66+
all: Array<any>
6667
current: any,
6768
error: Error
6869
}
6970
```
7071
71-
The `current` value or the `result` will reflect whatever is returned from the `callback` passed to
72-
`renderHook`. Any thrown values will be reflected in the `error` value of the `result`.
72+
The `current` value or the `result` will reflect the latest of whatever is returned from the
73+
`callback` passed to `renderHook`. Any thrown values from the latest call will be reflected in the
74+
`error` value of the `result`. The `all` value is an array containing all the returns (including the
75+
most recent) from the callback. These could be `result` or an `error` depending on what the callback
76+
returned at the time.
7377
7478
### `rerender`
7579

0 commit comments

Comments
 (0)