<ReactMapGL /> internally calls setState after the component is unmounted, triggering a React warning like this:
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
in InteractiveMap
You can reproduce this issue by putting a basic map like this on a page:
import ReactMapGL from 'react-map-gl'
<ReactMapGL
width="100px"
height="100px"
mapboxApiAccessToken="…"
/>
Then from another page, quickly navigate to the page and back again within a few seconds.
Fixed in 4.0.11
Most helpful comment
Fixed in 4.0.11