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

Bug: React 17 upgrade causes "Cannot read property 'removeEventListener' of null" #20080

Closed
greggailly opened this issue Oct 22, 2020 · 7 comments
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@greggailly
Copy link

We have upgraded to React 17 and since then we get Cannot read property 'removeEventListener' of null.
Mostly happens when component updates after state change.

React version: 17

Steps To Reproduce

  1. Upgrade to React 17
  2. Change page

The current behavior

Screenshot 2020-10-22 at 17 34 02

The expected behavior

No error

@greggailly greggailly added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Oct 22, 2020
@kachkaev
Copy link

👋Could you please share a reproducible example on https://codesandbox.io or as a repo?

@gaearon
Copy link
Collaborator

gaearon commented Oct 22, 2020

Could it be this?
https://reactjs.org/blog/2020/08/10/react-v17-rc.html#potential-issues

@greggailly
Copy link
Author

Probably ! Unfortunately seems to be coming from a library so we will check with them to fix this.
Thanks for the help.
Cheers

@liadb
Copy link

liadb commented Nov 17, 2020

We had the same issue, can confirm it came from rc-virtual-list which is an Ant Design Select dependency.
We resolved it by using rc-virtual-list 3.2.0

@nvbinh
Copy link

nvbinh commented Dec 7, 2020

I got the same issue when using a page with the Ant Design Tree component

Screen Shot 2020-12-07 at 17 02 12

VahanBeck added a commit to VahanBeck/ant-design that referenced this issue Jun 24, 2021
VahanBeck added a commit to VahanBeck/tree-select that referenced this issue Jun 24, 2021
VahanBeck added a commit to VahanBeck/ant-design that referenced this issue Jun 24, 2021
@riteshjagga
Copy link

As explained on this link (link from above),

We don’t expect this to be a common problem because our eslint-plugin-react-hooks/exhaustive-deps lint rule (make sure you use it!) has always warned about this.

I do not see any eslint warning related to this.

@lucaspdfborges
Copy link

lucaspdfborges commented May 21, 2022

I got the same issue when using a page with the Ant Design Tree component

Screen Shot 2020-12-07 at 17 02 12

I'm facing the same problem while testing a TreeSelect (antd) component with jest and React Testing Library. How did you solve this issue ? @nvbinh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

7 participants