11
我想停止点击事件冒泡。因此我在代码中添加了e.stopPropagation()。我总是在控制台中出现错误,它说:Uncaught TypeError: e.stopPropagation is not a function
如何在reactjs中调用stopPropagation?
什么是正确的方法来设置停止传播在reactjs?
handleClick: function(index, e) {
e.stopPropagation();
...
},
你可以发布你的代码吗?你在哪里调用'handleClick'?也许在你的第一个参数'Event'对象 - 尝试调用'console.log(typeof index.stopPropagation)' –