We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2bdb78a commit b2478e8Copy full SHA for b2478e8
test/typescript/renderHook.ts
@@ -1,4 +1,4 @@
1
-import { useState, useCallback } from 'react'
+import { useState, useCallback, useEffect } from 'react'
2
import { renderHook } from 'react-hooks-testing-library'
3
4
const useCounter = (initialCount: number = 0) => {
@@ -53,3 +53,14 @@ function checkTypesWithInitialProps() {
53
const _unmount: () => boolean = unmount
54
const _rerender: (_?: { count: number }) => void = rerender
55
}
56
+
57
+function checkTypesWhenHookReturnsVoid() {
58
+ const { result, unmount, rerender } = renderHook(() => useEffect(() => {}))
59
60
+ // check types
61
+ const _result: {
62
+ current: void
63
+ } = result
64
+ const _unmount: () => boolean = unmount
65
+ const _rerender: () => void = rerender
66
+}
0 commit comments