[ObsUX] Fix error when navigating from infra to other apps (#170564)

fixes https://github.com/elastic/kibana/issues/170562

## Summary

This PR fixes the error that happens when navigating from infra app to
another app while the charts are still loading


66cecf6d-96e5-4630-b968-aada98b6678a


### How to test

- Navigate to `Infrastructure` > `Hosts`
- While the charts are still loading, navigate to any other app.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Carlos Crespo 2023-11-06 09:30:13 +01:00 committed by GitHub
parent f423ad3fc3
commit 9def79267c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,6 +51,7 @@ export const renderApp = (
);
return () => {
plugins.data.search.session.clear();
core.chrome.docTitle.reset();
ReactDOM.unmountComponentAtNode(element);
};