ui/Changeable

Exports the ui/Changeable.Changeable Higher-order Component (HOC).

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

Members

ChangeableHigher-Order Component

ui/Changeable.Changeable is a Higher-order Component that applies a 'Changeable' behavior to its wrapped component. Its default event and value properties can be configured when applied to a component.

If the prop is overridden, the property names to set the default value and current value change correspondingly.

import Changeable from '@enact/ui/Changeable';
Configuration
change
String

Configures the prop name to pass the callback to change the value

Default: 'onChange'
prop
String

Configures the prop name to pass the current value

Default: 'value'
Properties added to wrapped component
change
Function

Event callback to notify that the value has changed. The event object must contain a property with the same name as the configured prop.

defaultPropKey
Any

Default value applied at construction when the value prop is undefined or null.

disabled
Boolean

Controls whether the component is disabled.

Default: false
prop
Any

Current value. When set at construction, the component is considered "controlled" and will only update its internal value when updated by new props. If undefined, the component is "uncontrolled" and Changeable will manage the value using callbacks defined by its configuration.

ArrayBooleanFunctionModuleNumberObjectString