3.1.0 [regression] stopPolling cleanup in effect #3482
Comments
Thanks for reporting this @mpgon. This is because of #3273, which automatically takes care of stopping polling when a component unmounts. You no longer have to call
I'll get these changes in place, but for now you should be okay to just remove your |
Alright, I'll do that then. Thank you! |
Polling is automatically stopped when a component is unmounted, so it isn't necessary to call `stopPolling` during component cleanup. If it is called though, we don't want to throw an exception, so these changes make it (and `startPolling`) a no-op if component cleanup has already happened. Fixes #3482
Polling is automatically stopped when a component is unmounted, so it isn't necessary to call `stopPolling` during component cleanup. If it is called though, we don't want to throw an exception, so these changes make it (and `startPolling`) a no-op if component cleanup has already happened. Fixes #3482
Polling is automatically stopped when a component is unmounted, so it isn't necessary to call `stopPolling` during component cleanup. If it is called though, we don't want to throw an exception, so these changes make it (and `startPolling`) a no-op if component cleanup has already happened. Fixes #3482
Hi, this bug is not fully fixed. Here's another case for you to consider and hopefully fix. I have a query hook that I pass Also, please don't forget to log some sort of warning message because other people won't know why the |
Intended outcome:
stopPolling
should be correctly called on effect cleanupActual outcome: Error: Uncaught [TypeError: Cannot read property 'stopPolling' of undefined]
How to reproduce the issue:
When using 3.0.1 the following component was successfully unit tested
however, after upgrading to 3.1.0 I get the following error in my unit tests
Error: Uncaught [TypeError: Cannot read property 'stopPolling' of undefined]
Reproduction example https://github.com/mpgon/stopPollingError
The text was updated successfully, but these errors were encountered: