Skip to content

Commit

Permalink
Use spread syntax instead of Object.assign, fixing a linting error
Browse files Browse the repository at this point in the history
  • Loading branch information
gakimball committed Nov 15, 2019
1 parent 117f529 commit f431f4e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Center.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ export default function Center(props) {
{/* Add centering attributes and classes to children */}
{Children.map(props.children, child => {
if (isValidElement(child)) {
return cloneElement(child, Object.assign({}, child.props, {
return cloneElement(child, {
...child.props,
align: 'center',
className: classnames(child.props.className, 'float-center')
}));
});
}

return child;
Expand Down

0 comments on commit f431f4e

Please sign in to comment.