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

Handle componentWillUnmount #45

Open
jondavidjohn opened this issue Dec 6, 2020 · 0 comments
Open

Handle componentWillUnmount #45

jondavidjohn opened this issue Dec 6, 2020 · 0 comments

Comments

@jondavidjohn
Copy link

First, this is a great component, thanks for sharing it!

I'm writing some simple specs using @testing-library/react and I'm getting this warning:

  console.error
    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.
        at Omnibar (/Users/.../node_modules/omnibar/dist/index.js:224:28)
        at Omnisearch

      at printWarning (node_modules/react-dom/cjs/react-dom.development.js:67:30)
      at error (node_modules/react-dom/cjs/react-dom.development.js:43:5)
      at warnAboutUpdateOnUnmountedFiberInDEV (node_modules/react-dom/cjs/react-dom.development.js:23914:9)
      at scheduleUpdateOnFiber (node_modules/react-dom/cjs/react-dom.development.js:21840:5)
      at Object.enqueueSetState (node_modules/react-dom/cjs/react-dom.development.js:12467:5)
      at Omnibar.Object.<anonymous>.Component.setState (node_modules/react/cjs/react.development.js:365:16)
      at node_modules/omnibar/dist/index.js:234:27

In doing some research, it looks like this may be of help => https://www.robinwieruch.de/react-warning-cant-call-setstate-on-an-unmounted-component

Does it look like maybe the component continues to get state updates after it is unmounted?

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

No branches or pull requests

1 participant