diff --git a/lib/Switch.js b/lib/Switch.js index afa524c..a5269e8 100644 --- a/lib/Switch.js +++ b/lib/Switch.js @@ -89,7 +89,7 @@ export class Switch extends Component { componentWillReceiveProps(nextProps) { const { disabled } = this.props; - if (nextProps.value === this.props.value) { + if (nextProps.value === this.props.value && nextProps.value === this.state.value) { return; } if (disabled && nextProps.disabled) { @@ -115,6 +115,7 @@ export class Switch extends Component { if (changeValueImmediately) { this.animateSwitch(!propValue); + this.setState({ value: !value }); onValueChange(!propValue); } else { this.animateSwitch(!value, () => {