Closed azmartone closed 7 years ago
Actually, those props are from aframe-mouse-cursor-component
That is true though, we do need to detach event props when those props are removed.
An idea on that front: Store the event map as a component property (this._eventMap
), then only attach a single event listener (regardless of if this._eventMap
has any values or not), then inside the event listener, the event name becomes the key into this._eventMap
.
We'd need to also add a componentWillReceiveProps()
to regenerate the this._eventMap
object, then everything else is handled without having to update anything or add / remove any event listeners.
v4.0.x will now diff the events
map and register/deregister as necessary.
We need a way to remove the events that get attached to the element.