@serenity-is/domwise / setRef
Function: setRef()
setRef<
T>(ref,current):void
Defined in: src/ref.ts:42
Assigns a value to a ref, handling both object and callback forms.
- If
refis aRefObject, itscurrentproperty is set tocurrent. - If
refis a function, it is invoked withcurrent. - If
refisnull/undefinedor neither form, no action is taken.
Type Parameters
T
T = Node
Type of the node/value being assigned.
Parameters
ref
Target RefObject, callback, or null/undefined.
Ref<T> | undefined
current
T
Value to assign to the ref.
Returns
void