我有以下功能(简化问题)
myFunction:function(event,key,value){
var target = event.currentTarget;
var weekDays = this.state.weekDays;
var weekDayIndex = _.findIndex(weekDays, { 'weekDay': target.id})
}
当如上所述在本地运行时效果很好,当代码部署到开发服务器时,它在webpack转换后呈现如下
myFunction: function(e, t, n) {
var o = e.currentTarget
, a = this.state.weekDays
, r = d["default"].findIndex(a, {
weekDay: o.id
})
}
在这种情况下,o为null,我收到以下错误 "未捕获的TypeError:无法读取属性' id' of null" 任何人都可以对此有所了解吗? 感谢