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

Warning while testing DataGrid which I believe is from useTubular #197

Open
nickpalmer opened this issue Jul 8, 2020 · 0 comments
Open
Assignees

Comments

@nickpalmer
Copy link

nickpalmer commented Jul 8, 2020

Describe the bug

While testing a component using DataGrid I am getting the following warning:

console.error ../../node_modules/react-dom/cjs/react-dom.development.js:88
      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 a useEffect cleanup function.

To Reproduce
Steps to reproduce the behavior:

  1. Write a test which mounts a DataGrid

Expected behavior
There shouldn't be a warning.

I believe this is caused by useTubular calling useEffect() but not returning a cleanup function, so the dispatch when the API call is complete fires after the component is unmounted.

Ideally the processRequest() api could be updated to handle the return of a Future which can be canceled. I will try to put a PR together to fix this, but no promises on timing on that.

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

2 participants