supermedium / aframe-react

:atom: Build virtual reality experiences with A-Frame and React.
https://ngokevin.github.io/aframe-react-boilerplate/
MIT License
1.42k stars 151 forks source link

🐛 : Remove events on unmount, delete dead code #91

Closed natseg closed 7 years ago

natseg commented 7 years ago

Hi,

I was experiencing an issue with a click triggering an event even after a component had unmounted. Maybe I misunderstood the intentions behind event management.

Let me know if it's ok.

Thanks

ngokevin commented 7 years ago

Cool thanks!, do you think you can add a unit test here? https://github.com/aframevr/aframe-react/blob/master/tests/browser/index.test.js ... use the events prop, then detach the component, and emit an event to make sure a callback is not called

natseg commented 7 years ago

Yes, done deal.

Thank you for creating this!