Skip to content

Commit 8aeb209

Browse files
authored
docs: make hook return all necessary variables (TanStack#1391)
1 parent 7786867 commit 8aeb209

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/src/pages/docs/guides/testing.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ Given the following custom hook:
5555

5656
```
5757
function useFetchData() {
58-
const { data } = useQuery('fetchData', () => request('/api/data'));
59-
return data;
58+
return useQuery('fetchData', () => request('/api/data'));
6059
}
6160
```
6261

@@ -85,7 +84,7 @@ await waitFor(() => {
8584
expect(result.current).toEqual({answer: 42});
8685
```
8786

88-
Here we are making use of `waitFor` and waiting until our Nock expectation indicates that it has been called. This way we know that our hook has finished and should have the correct data.
87+
Here we are making use of `waitFor` and waiting until our the query status indicates that the request has succeeded. This way we know that our hook has finished and should have the correct data.
8988

9089
## Testing Load More / Infinite Scroll
9190

0 commit comments

Comments
 (0)