Context
In a parent component we're updating a list of points of interest (POI) containing lon/lat coordinates and an id. We're then passing this list as a prop to a child component wrapping a resium's Viewer component.
In the child component, we're building dynamically a list of Entity component from the list of POIs. We have a useEffect hook which calls cesium's viewer flyTo method to the first entity every time the list of POI changes.
Expected
The viewer should fly to the first created entity every time the POI prop changes.
Observed
Nothing happens
Investigations
While debugging the calls stack, it seems that at the moment the flyTo method is being called in the useEffect callback, the viewer's DataSourceDisplay instance does not contain the new Entities collection when the getBoundingSphere method is being called on it. This result in a FAILED state for the entity bounding sphere which makes updateZoomTarget return early.