In MyComponent i added method componentWillUnmount(). When i refreshed page with canvas or went to another page unmounting didn't run. Have i made mistake here
handlers.onDestroy(() => ReactDOM.unmountComponentAtNode(domNode)); ?
your code looks correct. The onDestroy hook is only called when the element is removed from the screen while staying within the Canvas application (e.g. removing it in edit mode or switching canvas sheets).
When navigating away from the page or reloading the browser tears down and recreates the complete Kibana client which does not trigger the onDestroy hook.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.