Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calls setState after the component is unmounted #721

Closed
jaydenseric opened this issue Feb 6, 2019 · 1 comment
Closed

Calls setState after the component is unmounted #721

jaydenseric opened this issue Feb 6, 2019 · 1 comment
Assignees
Labels

Comments

@jaydenseric
Copy link

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

@Pessimistress
Copy link
Collaborator

Fixed in 4.0.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants