I'm looking to implement a custom ArcGIS API for JavaScript baseElevationLayer like the example provided here. I basically take the example ESRI provide that creates a custom class and put it in a function `getClass` that returns the class for me. In vanilla JavaScript all seems to work fine. Here is a CodePen of the code.
When I do the same thing in my React app, which uses esriLoader to load the API modules and react-arcgis to create a SceneView, loading this custom baseElevationLayer fails. Here is that in CodePen also.
If you look at the browser's developer console, you see an error about
"Cannot read properties of undefined (reading '_elevation')."
Can anyone spot what I'm missing?