|
@ -12,8 +12,7 @@ export default class Spin extends React.Component { |
|
|
|
|
|
|
|
|
constructor(props) { |
|
|
constructor(props) { |
|
|
super(props); |
|
|
super(props); |
|
|
const { spining } = props; |
|
|
const spinning = this.getSpinning(props); |
|
|
const spinning = props.spinning && spining; |
|
|
|
|
|
this.state = { |
|
|
this.state = { |
|
|
spinning, |
|
|
spinning, |
|
|
}; |
|
|
}; |
|
@ -34,9 +33,17 @@ export default class Spin extends React.Component { |
|
|
findDOMNode(this).className += ` ${this.props.prefixCls}-show-text`; |
|
|
findDOMNode(this).className += ` ${this.props.prefixCls}-show-text`; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
getSpinning(props) { |
|
|
|
|
|
warning(!('spining' in this.props), '`spining` property of Popover is a spell mistake, use `spinning` instead.'); |
|
|
|
|
|
const { spinning, spining } = props; |
|
|
|
|
|
// Backwards support |
|
|
|
|
|
if (spining !== undefined) { |
|
|
|
|
|
return spining; |
|
|
|
|
|
} |
|
|
|
|
|
return spinning; |
|
|
|
|
|
} |
|
|
componentWillReceiveProps(nextProps) { |
|
|
componentWillReceiveProps(nextProps) { |
|
|
const { spining = true } = nextProps; |
|
|
const spinning = this.getSpinning(nextProps); |
|
|
const spinning = nextProps.spinning && spining; // Backwards support |
|
|
|
|
|
if (this.debounceTimeout) { |
|
|
if (this.debounceTimeout) { |
|
|
clearTimeout(this.debounceTimeout); |
|
|
clearTimeout(this.debounceTimeout); |
|
|
} |
|
|
} |
|
|