Cesium viewer shows momentarily in div then dissappears

I’ve moved my cesium viewer creation higher within my react application state. I had it working fine in a page of my application, however I didnt want to have to reload the viewer every time I went to another page.

So I now still create the div in that page, and use a react “useRef” to keep track of when the div is mounted. At that point, I create the cesium viewer and it flashes in my div (it should be in that whitespace abovve the console (the word “Loaded” is in the upper left corner of the white rectangle where the cesium should be displayed)

You can also see in the picture that my viewer is created (the virtualearth errors were always there even when i had the viewer displaying properly in the old DOM architecture.

What are the things I should look at to figure out why the viewer shows briefly.. then dissappears. The div itself is properly mounted. It just doesnt show the viewer

I ended up fixing this. There were a number of things I wasnt doing right. At this point this is no longer an issue. I am now able to maintain the cesium viewer within a higher level context within my react application, and then make that context available to different views within the application.