fix: Row's children could be null

pull/1093/head
Benjy Cui 9 years ago
parent 770a408fe3
commit 380deaf54c

@ -29,15 +29,17 @@ const Row = React.createClass({
marginRight: gutter / -2,
...style,
} : style;
const cols = Children.map(children, col =>
cloneElement(col, {
const cols = Children.map(children, col => {
if (col === null) return null;
return cloneElement(col, {
style: gutter > 0 ? {
paddingLeft: gutter / 2,
paddingRight: gutter / 2,
...col.props.style
} : col.props.style,
})
);
});
});
return <div {...others} className={classes} style={rowStyle}>{cols}</div>;
},
});

Loading…
Cancel
Save