This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

resolveForwardRef

Lazily retrieves the reference value from a forwardRef.

See more...

resolveForwardRef(type: any): any
      
      resolveForwardRef(type: any): any
    

Parameters

type

Type: any.

Returns

any

See also

Description

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

Usage notes

Example

const ref = forwardRef(() => 'refValue'); expect(resolveForwardRef(ref)).toEqual('refValue'); expect(resolveForwardRef('regularValue')).toEqual('regularValue');
      
      const ref = forwardRef(() => 'refValue');
expect(resolveForwardRef(ref)).toEqual('refValue');
expect(resolveForwardRef('regularValue')).toEqual('regularValue');