rogain-component-each
Returns a tree of the data
mapped to children. Each child can access the current element with the @item
(or as
attribute) properties and the current index with @index
or @key
.
<Each data={searchResults} as="result">
<Card title={result.title} contents={result.excerpt} />
</Each>
Attributes
data
Variable. Array or Object.
as
String. Optional. Defines the local variable name for accessing each element in data
. Defaults to @item
.
Install
With npm do:
npm install rogain-component-each
License
MIT