control-flow-react
Version:
Control flow components for React
8 lines • 404 B
JavaScript
import React from "react";
export var For = function (_a) {
var each = _a.each, children = _a.children, _b = _a.emptyState, emptyState = _b === void 0 ? null : _b;
return (React.createElement(React.Fragment, null, each && Array.isArray(each) && each.length > 0
? each.map(function (item, index) { return children(item, index); })
: emptyState));
};
//# sourceMappingURL=for.js.map