_handleChangeSwitch(active) {
this.props.changeSwitch({
type: CHANGE_WARRANTY,
active
})
}
<Switch
checked={needExtInsurance}
onChange={this._handleChangeSwitch}
/>
active获取到的不是Boolean值而是一个对象
报错如下:
index.js:1375 Warning: This synthetic event is reused for performance reasons. If you're seeing this, you're accessing the property nativeEvent
on a released/nullified synthetic event. This is set to null. If you must keep the original synthetic event around, use event.persist(). See https://fb.me/react-event-poo... for more information.
根据题主你给的代码,给出以下猜测:
switch组件绑定的
checked
的值和onChange
存储的值不是同一个,或许应该是这样的