Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a334f80

Browse files
fix: Restore 'RenderHookOptions' type (testing-library#535)
1 parent 10d9a28 commit a334f80

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/pure.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,14 @@ function resultContainer<TValue>() {
7373
}
7474
}
7575

76+
export interface RenderHookOptions<TProps> {
77+
initialProps?: TProps
78+
wrapper?: React.ComponentType<TProps>
79+
}
80+
7681
function renderHook<TProps, TResult>(
7782
callback: (props: TProps) => TResult,
78-
{ initialProps, wrapper }: {initialProps?: TProps;wrapper?: React.ComponentType<TProps>} = {}
83+
{ initialProps, wrapper }: RenderHookOptions<TProps> = {}
7984
) {
8085
const { result, setValue, setError, addResolver } = resultContainer<TResult>()
8186
const hookProps = { current: initialProps }

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /