ui/Measurable

A higher-order component that adds the ability to measure nodes conveniently.

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

Members

MeasurableHigher-Order Component

A higher-order component that adds the ability to measure a referenced node and get that value back as a prop.

Applying Measurable to a component will pass two additional props: function to fetch the ref and the measurement object (currently this executes getBoundingClientRect returning its full complement of properties). Both prop names are configurable through the HOC config object.

Changes to the referenced node will result in new measurements being returned as props. That being said, it probably is not wise to use this during animation as it may cause unwanted performance issues.

import Measurable from '@enact/ui/Measurable';
Configuration
measurementProp
String

Configures the prop name to pass the measurement object.

Default: 'measurement'
refProp
String

Configures the prop name to pass a function to capture a reference to the element to measure.

Default: 'forwardRef'
ArrayBooleanFunctionModuleNumberObjectString