W3cubDocs

/Angular

resolveForwardRef

Lazily retrieves the reference value from a forwardRef.

API

function resolveForwardRef<T>(type: T): 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');

Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/core/resolveForwardRef