Skip to content

API Reference / @gtkx/testing / RenderHookResult

Type Alias: RenderHookResult<Result, Props>

RenderHookResult<Result, Props> = object

Defined in: packages/testing/dist/types.d.ts:210

The result of renderHook: the latest hook return value plus functions to rerender with new props and to unmount.

Type Parameters

Result

Result

Props

Props

Properties

rerender

rerender: (newProps?) => Promise<void>

Defined in: packages/testing/dist/types.d.ts:217

Re-invokes the hook, keeping the previous props when none are given.

Parameters

newProps?

Props

Returns

Promise<void>


result

result: object

Defined in: packages/testing/dist/types.d.ts:212

Stable object the hook's return value is written to on every render.

current

current: Result

The hook's latest return value.


unmount

unmount: () => Promise<void>

Defined in: packages/testing/dist/types.d.ts:219

Unmounts the component that calls the hook.

Returns

Promise<void>

Released under the MPL-2.0 License.