geneontology / ribbon

(DEPRECATED) Short form matrix view of all GO annotations for a given gene
BSD 3-Clause "New" or "Revised" License
4 stars 7 forks source link

removing click event listener before FilterDropdown unmounts fixes Uncaught Invariant Violation error #101

Open olchowik opened 5 years ago

olchowik commented 5 years ago

When clicking many times quickly on the ribbon following error occurs in the javascript console: " Uncaught Invariant Violation: Unable to find node on an unmounted component. "

FilterDropdown adds EventListener to the document and does not remove it before unmounting. It results in accumulation of the Eventlisteners to the click event. To fix this I remove EventListener in FilterDropdown componentWillUnmount lifecycle method.

I dont know how exactly it relates to "Unable to find node on an unmounted component.", but when Eventlistener is removed before the component is unmounted the error seems not to occur any more.

lpalbou commented 5 years ago

Hi @olchowik, thanks for your PR. The current ribbon is in heavy re-write right now and will be later delivered as a web component for broader compatibility. If you wish, I could still look at your PR later.