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, marginRight: gutter / -2,
...style, ...style,
} : style; } : style;
const cols = Children.map(children, col => const cols = Children.map(children, col => {
cloneElement(col, { if (col === null) return null;
return cloneElement(col, {
style: gutter > 0 ? { style: gutter > 0 ? {
paddingLeft: gutter / 2, paddingLeft: gutter / 2,
paddingRight: gutter / 2, paddingRight: gutter / 2,
...col.props.style ...col.props.style
} : col.props.style, } : col.props.style,
}) });
); });
return <div {...others} className={classes} style={rowStyle}>{cols}</div>; return <div {...others} className={classes} style={rowStyle}>{cols}</div>;
}, },
}); });

Loading…
Cancel
Save