Skip to content

Memory leak caused by componentWillUnmount  #419

Open
@harriethorobinworley

Description

@harriethorobinworley

We're running a React 16.12 app, using the autocomplete within a form, and seeing the following warning:

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

It looks like this is caused by

componentWillUnmount () { clearTimeout(this.$pollInput) }

in autocomplete.js or status.js

It looks like this can be fixed by adding a _isMounted boolean -https://stackoverflow.com/questions/52061476/cancel-all-subscriptions-and-asyncs-in-the-componentwillunmount-method-how or by using cancelable callbacks?

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigation🕔 hoursA well understood issue which we expect to take less than a day to resolve.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions