resolveForwardRef
function
Lazily retrieves the reference value from a forwardRef.
resolveForwardRef
T
Lazily retrieves the reference value from a forwardRef.
Acts as the identity function when given a non-forward-ref value.
@paramtype
T
@returns
T
Description
Lazily retrieves the reference value from a forwardRef.
Acts as the identity function when given a non-forward-ref value.
Usage Notes
Example
const ref = forwardRef(() => 'refValue'); expect(resolveForwardRef(ref as any)).toEqual('refValue'); expect(resolveForwardRef('regularValue')).toEqual('regularValue');
Jump to details