Skip to main content

# renderHook()

    function renderHook<Result, Props, Q, Container, BaseElement>(render: (initialProps: Props) => Result, options?: RenderHookOptions<Props, Q, Container, BaseElement>): RenderHookResult<Result, Props>;

Allows you to render a hook within a test React component without having to create that component yourself.

## Type Parameters​

### Result​

`Result`

### Props​

`Props`

### Q​

`Q` extends `Queries` = `__module`

### Container​

`Container` extends `Element` | `DocumentFragment` = `HTMLElement`

### BaseElement​

`BaseElement` extends `Element` | `DocumentFragment` = `Container`

## Parameters​

### render​

(`initialProps`: `Props`) => `Result`

### options?​

`RenderHookOptions`<`Props`, `Q`, `Container`, `BaseElement`>

## Returns​

`RenderHookResult`<`Result`, `Props`>