react avoid spreading non-dom props across component
function MyDiv(props) { const divProps = Object.assign({}, props); delete divProps.layout; if (props.layout === 'horizontal') { return <div {...divProps} style={getHorizontalStyle()} /> } else { return <div {...divProps} style={getVerticalStyle()} /> } }