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 @@ -110,7 +110,7 @@ interface RenderHookOptions<Props> {
110
110
111
111
// TODO JSDOC
112
112
export function renderHook < Result , Props > (
113
- render : ( initialProps ? : Props ) => Result ,
113
+ render : ( initialProps : Props ) => Result ,
114
114
options ?: RenderHookOptions < Props > ,
115
115
) : RenderHookResult < Result , Props >
116
116
Original file line number Diff line number Diff line change @@ -110,6 +110,19 @@ export function testRenderHook() {
110
110
unmount ( )
111
111
}
112
112
113
+ export function testRenderHookProps ( ) {
114
+ const { result, rerender, unmount} = renderHook (
115
+ ( { defaultValue} ) => React . useState ( defaultValue ) [ 0 ] ,
116
+ { initialProps : { defaultValue : 2 } } ,
117
+ )
118
+
119
+ expectType < number , typeof result . current > ( result . current )
120
+
121
+ rerender ( )
122
+
123
+ unmount ( )
124
+ }
125
+
113
126
/*
114
127
eslint
115
128
testing-library/prefer-explicit-assert: "off",
You can’t perform that action at this time.
0 commit comments