File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -89,27 +89,25 @@ function renderHook<TProps, TResult>(
89
89
</ Suspense >
90
90
) as ReactElement
91
91
92
- let testRenderer : ReactTestRenderer | undefined
92
+ let testRenderer : ReactTestRenderer
93
93
// eslint-disable-next-line @typescript-eslint/no-floating-promises
94
94
act ( ( ) => {
95
95
testRenderer = create ( toRender ( ) )
96
96
} )
97
- // eslint-disable-next-line @typescript-eslint/unbound-method
98
- const { unmount, update } = testRenderer as ReactTestRenderer
99
-
97
+
100
98
function rerenderHook ( newProps : typeof initialProps = hookProps . current ) {
101
99
hookProps . current = newProps
102
100
// eslint-disable-next-line @typescript-eslint/no-floating-promises
103
101
act ( ( ) => {
104
- update ( toRender ( ) )
102
+ testRenderer . update ( toRender ( ) )
105
103
} )
106
104
}
107
105
108
106
function unmountHook ( ) {
109
107
// eslint-disable-next-line @typescript-eslint/no-floating-promises
110
108
act ( ( ) => {
111
109
removeCleanup ( unmountHook )
112
- unmount ( )
110
+ testRenderer . unmount ( )
113
111
} )
114
112
}
115
113
You can’t perform that action at this time.
0 commit comments