Git Product home page Git Product logo

Comments (11)

ostenning avatar ostenning commented on August 15, 2024 5

Also experiencing this, with a solid reproduction path, it happens predictably when NextJS 8.1.0 hot reloads.

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 LoadScript (at Map.tsx:87)
    in Map (at TripDetailsMap.tsx:94)
    in section (created by Context.Consumer)
    in StyledComponent (created by TripDetailsMap__InnerWrapper)

Update: I switched from <LoadScript /> to <LoadScriptNext /> and switched to the React Hooks API and I no longer experience this problem. I'll update further if it resurfaces.

from react-google-maps-api.

uriklar avatar uriklar commented on August 15, 2024 1

Hi @MiguelGPereira. Thanks a lot for the super detailed bug report.
I'll look into it in the next couple of days

from react-google-maps-api.

JustFly1984 avatar JustFly1984 commented on August 15, 2024 1

@MiguelGPereira please check new @react-google-maps/[email protected] version. It should resolve your error.

from react-google-maps-api.

mpgon avatar mpgon commented on August 15, 2024 1

@nojaf unfortunately not, we ended up migrating to mapbox and react-map-gl

from react-google-maps-api.

mpgon avatar mpgon commented on August 15, 2024

UPDATE: I managed to reproduce this problem without lazy loading, so it might not be solely related to that. However, lazy loading makes this problem easier to reproduce, without lazy loading is considerably harder. I'll update the title and the description accordingly.

from react-google-maps-api.

JustFly1984 avatar JustFly1984 commented on August 15, 2024

@MiguelGPereira I've tested your codesandbox example with @1.0.10, and it seems there is no issue

from react-google-maps-api.

mpgon avatar mpgon commented on August 15, 2024

@JustFly1984 I updated to the new version but the problem still occurs, although it looks harder to reproduce. But even in the codesandbox w/@1.0.10 it still happens, try a few times clicking fast between Refresh and Map OFF, and you'll see the Warning: Can't perform a React state update on an unmounted component in LoadScript in the console. You might want to add an API_KEY to the const in "map.js" so the error You have exceeded your request quota for this API doesn't appear first.

from react-google-maps-api.

nojaf avatar nojaf commented on August 15, 2024

Hi @mpgon I'm having the same error react-dom.development.js?7f13:546 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 LoadScript

Were you ever able to solve this?

from react-google-maps-api.

JustFly1984 avatar JustFly1984 commented on August 15, 2024

@uriklar mention

from react-google-maps-api.

JustFly1984 avatar JustFly1984 commented on August 15, 2024

considering issue closed

from react-google-maps-api.

mattvb91 avatar mattvb91 commented on August 15, 2024

@ostenning i am still experiencing the same issue even when switching to LoadScriptNext. Could you expand on what you "switched" to the react hooks API? Im not really sure what I should switch to it?

from react-google-maps-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.