Home > @pago/reactive > useRefValue

useRefValue() function

Returns the current value of a RefObject and starts to track its value once the component has been mounted.

An update will be scheduled if the value of the reference has changed between the first render of the component and mounting it.

Signature:

export declare function useRefValue<T>(ref: RefObject<T>): T;

Parameters

Parameter Type Description
ref RefObject<T> A tracked reference object.

Returns:

T