Use spread operator instead of React.createElement

This commit is contained in:
Brandon Millman
2018-06-13 12:01:08 -07:00
parent d0bbee7e8c
commit 14071ea119
3 changed files with 7 additions and 7 deletions

View File

@@ -75,7 +75,7 @@ export const BenefitsList = () => {
return (
<div>
<HeaderItem headerText={HEADER_TEXT} />
{_.map(BENEFIT_ITEM_PROPS_LIST, valueItemProps => React.createElement(BenefitItem, valueItemProps))}
{_.map(BENEFIT_ITEM_PROPS_LIST, valueItemProps => <BenefitItem {...valueItemProps} />)}
</div>
);
};

View File

@@ -48,11 +48,11 @@ const LargeLayout = () => (
<div className="mx-auto max-width-4 clearfix pb4">
<div className="col lg-col-6 md-col-6 col-12">
<HeaderItem headerText={HEADER_TEXT} />
{_.map(TEAM_ITEM_PROPS_COLUMN1, teamItemProps => React.createElement(TeamItem, teamItemProps))}
{_.map(TEAM_ITEM_PROPS_COLUMN1, teamItemProps => <TeamItem {...teamItemProps} />)}
</div>
<div className="col lg-col-6 md-col-6 col-12">
<HeaderItem headerText=" " />
{_.map(TEAM_ITEM_PROPS_COLUMN2, teamItemProps => React.createElement(TeamItem, teamItemProps))}
{_.map(TEAM_ITEM_PROPS_COLUMN2, teamItemProps => <TeamItem {...teamItemProps} />)}
</div>
</div>
);
@@ -60,9 +60,9 @@ const LargeLayout = () => (
const SmallLayout = () => (
<div>
<HeaderItem headerText={HEADER_TEXT} />
{_.map(_.concat(TEAM_ITEM_PROPS_COLUMN1, TEAM_ITEM_PROPS_COLUMN2), teamItemProps =>
React.createElement(TeamItem, teamItemProps),
)}
{_.map(_.concat(TEAM_ITEM_PROPS_COLUMN1, TEAM_ITEM_PROPS_COLUMN2), teamItemProps => (
<TeamItem {...teamItemProps} />
))}
</div>
);

View File

@@ -29,7 +29,7 @@ export const Values = () => {
return (
<div className="mx-auto max-width-4">
<HeaderItem headerText={HEADER_TEXT} />
{_.map(VALUE_ITEM_PROPS_LIST, valueItemProps => React.createElement(ValueItem, valueItemProps))}
{_.map(VALUE_ITEM_PROPS_LIST, valueItemProps => <ValueItem {...valueItemProps} />)}
</div>
);
};