diff --git a/src/comp/switch.jsx b/src/comp/switch.jsx index 7c3cd11e..a5ab57b9 100644 --- a/src/comp/switch.jsx +++ b/src/comp/switch.jsx @@ -193,6 +193,10 @@ export default class Switch extends React.Component { !this.props.disable && this.props.onChange && this.props.onChange( !this.state.checked ); } + componentWillReceiveProps( nextProps ) { + this.setState({ checked: nextProps.checked }); + } + render() { const style = { ...cssinjs() }; styles.set( this.state.id, style );