Skip to content

@serenity-is/corelib / useImperativeHandle

Function: useImperativeHandle()

useImperativeHandle<T>(ref, init): void

Defined in: ../domwise/dist/index.d.ts:2445

Compatibility helper similar to React's useImperativeHandle.

Evaluates init() and forwards the result to ref via setRef. Prefer calling setRef directly in new code.

Type Parameters

T

T

Type of the value exposed through the ref.

Parameters

ref

Ref<T>

Target RefObject or ref callback to update.

init

() => T

Factory that produces the value to assign to the ref.

Returns

void