module.exports = React.createClass({
click: function(e){
console.log(e)
},
render: function() {
return div({className: "thing1", children:[
div({className: "thing2", onClick: this.click})
]})
}
})
传递给的事件包含所有制作的点击对象,但值为空。React.js onClick事件返回所有空值
Object { dispatchConfig: null, dispatchMarker: null, nativeEvent: null, type: null, target: null, currentTarget: null, eventPhase: null, bubbles: null, cancelable: null, timeStamp: null, 22 more… }
任何想法?
谢谢,理解,很好的答案。 – boom 2014-10-11 19:54:41
为了简单的调试目的,在记录事件之前调用事件上的persist()可能是一个很好的解决方法。 – 2014-10-12 02:41:49