react-google-maps
react-google-maps copied to clipboard
[Bug] `renderingType` is incompatible with `reuseMaps`
Description
I get an error like this:
Uncaught Error: Setting map 'renderingType' after instantiation is not supported.
It does not throw if only one of renderingType and reuseMaps is supplied.
Steps to Reproduce
- Create a
Maplike this:
<Map
renderingType={google.maps.RenderingType.VECTOR}
reuseMaps
/>
- Mount it.
- Unmount it.
- Mount it.
Environment
- Library version: 1.1.0
- Google maps version: weekly
- Browser and Version: Google Chrome 127.0.6533.72
- OS: Arch Linux
Logs
main.js:6937 Uncaught Error: Setting map 'renderingType' after instantiation is not supported.
at lca.renderingType_changed (main.js:367:1635)
at Xk (main.js:140:251)
at Xk (main.js:140:311)
at _.Vk.set (main.js:260:719)
at jo.setRenderingType (main.js:148:354)
at _.Vk.setValues (main.js:261:242)
at main.js:23769:12
at commitHookEffectListMount (main.js:6949:114)
at commitPassiveMountOnFiber (main.js:7162:1577)
at commitPassiveMountEffects_complete (main.js:7162:872)
I wasn't aware that the renderingType can't be changed after the map is created, we'll have to adjust our implementation so renderingType is treated like the mapId, creating a new map instance when changed this should then also make it work with reuseMaps.