You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
598 B
17 lines
598 B
import type { ComponentType } from 'react';
|
|
export type RenderHookResult<Result, Props> = {
|
|
rerender: (props: Props) => void;
|
|
result: {
|
|
current: Result;
|
|
};
|
|
unmount: () => void;
|
|
};
|
|
export type RenderHookOptions<Props> = Props extends object | string | number | boolean ? {
|
|
initialProps: Props;
|
|
wrapper?: ComponentType<any>;
|
|
} : {
|
|
wrapper?: ComponentType<any>;
|
|
initialProps?: never;
|
|
} | undefined;
|
|
export declare function renderHook<Result, Props>(renderCallback: (props: Props) => Result, options?: RenderHookOptions<Props>): RenderHookResult<Result, Props>;
|