We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9fb2dbf commit a72a1a5Copy full SHA for a72a1a5
test/typescript/renderHook.ts
@@ -64,3 +64,12 @@ function checkTypesWhenHookReturnsVoid() {
64
const _unmount: () => boolean = unmount
65
const _rerender: () => void = rerender
66
}
67
+
68
+async function checkTypesForNextUpdate() {
69
+ const { nextUpdate } = renderHook(() => {})
70
71
+ await nextUpdate()
72
73
+ // check type
74
+ const _nextUpdate: () => Promise<void> = nextUpdate
75
+}
typings/index.d.ts
@@ -9,6 +9,7 @@ export function renderHook<P, R>(
9
readonly result: {
10
current: R
11
12
+ readonly nextUpdate: () => Promise<void>
13
readonly unmount: RenderResult['unmount']
14
readonly rerender: (hookProps?: P) => void
15
0 commit comments