react-map-gl
react-map-gl copied to clipboard
reuseMap with different props
Description
It seems that when reusing a map and you unmount and mount the map somewhere else with different props (e.g. with isInteractive switched to false on re-mount) the map would still be interactive when you actually expect it not to be.
Expected Behavior
No response
Steps to Reproduce
- Render map using
reuseMaps={true}withisInteractive={true} - Then unmount and remount with the map with
isInteractive={false} - The map will be interactive even though it shouldnt.
Environment
- Framework version: "react": "^17.0.2",
- Map library: "^7.0.18"
- Browser: Chrome
- OS: MacOS
Logs
No response
https://visgl.github.io/react-map-gl/docs/api-reference/map#reusemaps
Note that since some map options cannot be modified after initialization, when reusing maps, only the reactive props and initialViewState of the new component are respected.