@serenity-is/domwise / useImperativeHandle
Function: useImperativeHandle()
useImperativeHandle<
T>(ref,init):void
Defined in: src/compat-api.ts:47
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