Make supported() check optional (#2179)

This commit is contained in:
Xiaoji Chen 2023-05-24 08:55:53 -07:00 committed by GitHub
parent 51a6a2c8f1
commit 2244babaae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,7 +63,7 @@ function Map(props: MapProps, ref: React.Ref<MapRef>) {
// workerUrl & workerClass may change the result of supported()
// https://github.com/visgl/react-map-gl/discussions/2027
setGlobals(mapboxgl, props);
if (mapboxgl.supported(props)) {
if (!mapboxgl.supported || mapboxgl.supported(props)) {
if (props.reuseMaps) {
mapbox = Mapbox.reuse(props, containerRef.current);
}