ui/Repeater

A repeater component.

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

Members

RepeaterComponent

A stateless component that stamps out copies of childComponent.

import Repeater from '@enact/ui/Repeater';
Properties
childComponent
Component

Component type to repeat.

This can be a React component or a string describing a DOM node (e.g. 'div').

children
ArrayStringArrayObject

An array of data to be mapped onto the childComponent.

This supports two data types. If an array of strings is provided, the strings will be used in the generated childComponent as the readable text. If an array of objects is provided, each object will be spread onto the generated childComponent with no interpretation. You'll be responsible for setting properties like disabled, className, and setting the text content using the children key.

NOTE: When an array of objects is provided, make sure a unique key is assigned to each data. See https://fb.me/react-warning-keys for more information.

childProp
String

The property on each childComponent that receives the data in children.

Default: 'children'
indexProp
String

The property on each childComponent that receives the index of the item in the Repeater.

Default: 'data-index'
itemProps
Object

An object containing properties to be passed to each child.

ArrayBooleanFunctionModuleNumberObjectString