Fix props warning, close #2253

https://fb.me/react-unknown-prop
This commit is contained in:
afc163 2016-07-04 12:13:05 +08:00
parent c3949bb9b1
commit 09d00f1f30
2 changed files with 6 additions and 1 deletions

View File

@ -123,8 +123,12 @@ export default class Affix extends React.Component {
'ant-affix': this.state.affixStyle,
});
const props = { ...this.props };
delete props.offsetTop;
delete props.offsetBottom;
return (
<div {...this.props}>
<div {...props}>
<div className={className} ref="fixedNode" style={this.state.affixStyle}>
{this.props.children}
</div>

View File

@ -14,6 +14,7 @@ export default function Col(props) {
} else if (typeof props[size] === 'object') {
sizeProps = props[size] || {};
}
delete others[size];
sizeClassObj = {
...sizeClassObj,
[`ant-col-${size}-${sizeProps.span}`]: sizeProps.span !== undefined,