ui/ForwardRef

A higher-order component interface for ref forwarding.

import ForwardRef from '@enact/ui/ForwardRef';

Members

ForwardRefHigher-Order Component

A higher-order component that adapts React.forwardRef to be chainable with other HOCs.

The following examples are equivalent:

import ForwardRef from '@enact/ui/ForwardRef';
import Component from './Component';

React.forwardRef((props, ref) => (
	<Component {...props} setMyRef={ref} />
));
ForwardRef({prop: 'setMyRef'}, Component);
import ForwardRef from '@enact/ui/ForwardRef';
Configuration
prop
String

The prop name to pass the ref callback

Default: 'forwardRef'
ArrayBooleanFunctionModuleNumberObjectString