React-map-gl: Calls setState after the component is unmounted

Created on 6 Feb 2019  Â·  1Comment  Â·  Source: visgl/react-map-gl

<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.

bug

Most helpful comment

Fixed in 4.0.11

>All comments

Fixed in 4.0.11

Was this page helpful?
0 / 5 - 0 ratings

Related issues

huaying picture huaying  Â·  5Comments

yangshun picture yangshun  Â·  4Comments

miccferr picture miccferr  Â·  4Comments

iamvdo picture iamvdo  Â·  5Comments

jenyeeiam picture jenyeeiam  Â·  4Comments