azat-co / react-quickly

Source code for React Quickly [Manning, 2017]: Painless Web Apps with React, JSX, Redux, and GraphQL 📕
http://reactquickly.co
MIT License
544 stars 422 forks source link

Can't remove event listener #10

Open sinewave440hz opened 7 years ago

sinewave440hz commented 7 years ago

Hi Azat, in Chapter 6 just past Figure 6-6 you write getEventListeners(document).mouseover[0].remove() but this gives me 'VM6598:1 Uncaught TypeError: getEventListeners(...).mouseover[0].remove is not a function at :1:42' in the console...do you know what should be used instead and why this no longer works - as I mentioned in the previous issue, I did not need the binding and I wonder if this is related...

sflahave commented 6 years ago

Here's how I got it to work:

document.removeEventListener('mouseover', getEventListeners(document).mouseover[0].listener, false)
akaigyouhou commented 3 years ago

I have the same problem. And also I can’t find the target node in event object ( in getEventListener(document) ).