1
0
mirror of https://github.com/bobwen-dev/react-templates synced 2025-04-12 00:56:39 +02:00
react-templates/test/data/repeat-with-index.rt.js

17 lines
419 B
JavaScript

define([
'react',
'lodash'
], function (React, _) {
'use strict';
function repeatItem1(item, customIndex) {
return React.createElement('li', {}, item, ' is number ', customIndex);
}
return function () {
return React.createElement.apply(this, [
'ul',
{},
_.map(this.props.collection, repeatItem1.bind(this, customIndex))
]);
};
});