I am trying to make sure the map view is ready when using components before accessing it to zoom to a location, etc. The official way I found to do this was to use the mapView.viewOnReady method as seen in the release notes for version 4.33 here https://developers.arcgis.com/javascript/latest/4.33/ .
However, it seems like 1/10 of the time I load my web application I get the error that viewOnReady is not a function. Is there a better official/more robust way to make sure the map view element is loaded before trying to call this viewOnReady method than the below?
const viewElement = document.getElementById("map-component");
await viewElement.viewOnReady();