resolveForwardRef

Lazily retrieves the reference value from a forwardRef.

resolveForwardRef(type: any): any

参数

type

Type: any.

返回值

any

参见

说明

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

使用说明

Example

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