In my code I dynamically add a basemapGallery:
basemapGallery = document.createElement('arcgis-basemap-gallery');
basemapGallery.position = "bottom-right";
mapDiv.appendChild(basemapGallery);I remove the basemapGallery by pressing a button:
if (basemapGallery.destroy && typeof basemapGallery.destroy === 'function') { basemapGallery.destroy(); }
basemapGallery = null;Using API 4.32 this works when I use the imports:
<link rel="stylesheet" href="/arcgis_js/javascript/4.32/esri/themes/light/main.css">
<script src="/arcgis_js/javascript/4.32/init.js"></script>
<script type="module" src="https://js.arcgis.com/map-components/4.32/index.js"></script>
But when I use the API 4.33 imports, I get an error on basemapGallery.destroy():
<link rel="stylesheet" href="/arcgis_js/javascript/4.33/esri/themes/light/main.css">
<script src="/arcgis_js/javascript/4.33/init.js"></script>
<script type="module" src="https://js.arcgis.com/map-components/4.33/index.js"></script>
The error is:
Uncaught (in promise) TypeError: can't access property "state", this.source is undefined