File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ interface RenderHookOptions<Props> {
105
105
106
106
// TODO JSDOC
107
107
export function renderHook < Result , Props > (
108
- render : ( initialProps ? : Props ) => Result ,
108
+ render : ( initialProps : Props ) => Result ,
109
109
options ?: RenderHookOptions < Props > ,
110
110
) : RenderHookResult < Result , Props >
111
111
Original file line number Diff line number Diff line change @@ -151,6 +151,19 @@ export function testRenderHook() {
151
151
unmount ( )
152
152
}
153
153
154
+ export function testRenderHookProps ( ) {
155
+ const { result, rerender, unmount} = renderHook (
156
+ ( { defaultValue} ) => React . useState ( defaultValue ) [ 0 ] ,
157
+ { initialProps : { defaultValue : 2 } } ,
158
+ )
159
+
160
+ expectType < number , typeof result . current > ( result . current )
161
+
162
+ rerender ( )
163
+
164
+ unmount ( )
165
+ }
166
+
154
167
/*
155
168
eslint
156
169
testing-library/prefer-explicit-assert: "off",
You can’t perform that action at this time.
0 commit comments