• Overview
@angular/core

resolveForwardRef

function

Lazily retrieves the reference value from a forwardRef.

API

  
    function resolveForwardRef<T>(  type: T): T;
  
  

resolveForwardRef

T

Lazily retrieves the reference value from a forwardRef.

Acts as the identity function when given a non-forward-ref value.

@paramtypeT
@returnsT

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