-
Notifications
You must be signed in to change notification settings - Fork 46
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
Error in console - Cannot read property 'capture' of null #23
Comments
Hey @ddtch, Also:
|
Okay, I figured out what's going on - in index.js:36 we check |
@FRSgit this helped and there is no error I reported, but no I got error. Here code from my component where I import passive events lib
After I navigate to SomePage everything is fine. But when I pressed browser's 'back button' got error in console warning.js:33 Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the SomePage component. As I see for some reason eventListener actually not removes. So can you help me understand where the problem is? |
Okay, that one is connected with a way I've handled #19. Need another way to handle that one - I'm creating a wrapper around function passed to addEventListener, so it's not this.onScrollEvent anymore, but it's wrapper - that's why you later can't remove it properly (you try to remove listener this.onScrollEvent, but it won't work because our wrapper is actually the thing you should try to pass as a listener). Give me some time to think about that, because now I don't have any good idea how to handle that one without regression on #19 (which I would like to avoid). |
ok, on weekend I also will think about it. |
Also - need to there is need to write test checking if removeEventListener functionality works well. |
Sorry, was on holidays for last weeks. Today I've started working on the problem here WICG/interventions#63 - or rather on how properly find out if current listener is passive or not. |
Unfortunately to bring important functionality of removingEventListener I needed to regress the package and remove fix for #19. Problem is that "error message" caused by firing preventDefault in passive listener is not actually an error (under the hood it's just console.error), so it's not possible to catch & silence it. In addition to what's above I've created issue on WHATWG repo - whatwg/dom#587 - let's see if anything will be done to cover our case. Closing as fixed, rest of work is in hands of browser suppliers. |
I imported 'default-passive-events' in one of my components where I use event listener and it was fine, but now when I navigate throw site, on one of the pages I got error like

I tried to remove all window and document listeners, to found a problem but that didn't helped. Any ideas || suggestions?
The text was updated successfully, but these errors were encountered: