react-virtualized icon indicating copy to clipboard operation
react-virtualized copied to clipboard

WindowScroller Invariant Violation: Unable to find node on an unmounted component.

Open diogomiguel opened this issue 4 years ago • 2 comments

What is the current behavior?

An Invariant Violation: Unable to find node on an unmounted component. is randomly triggered by WindowScroller whenever the window resize event is triggered.

This happens on the line var thisNode = this._child || ReactDOM.findDOMNode(this);

This happens regardless of registerChild prop being assigned or not. Was able to reproduce in a few instances when

  • Component unmounts: resize listener is not cleared;
  • Component unmounts: resize listener is cleared but before doing so the error is triggered;
  • Component mounts + resize event triggered.

Potentially checking against this._isMounted before running findDOMNode would prevent issue.

What is the expected behavior?

Do not attempt to call ReactDOM.findDOMNode if this is an unmounted component. Investigate why resize event is not cleared on unmount.

Which versions of React and react-virtualized, and which browser / OS are affected by this issue? Did this work in previous versions of react-virtualized?

Browser Safari, Chrome and Firefox
OS Irrelevant
React 16.8.6
React DOM 16.8.6
react-virtualized 9.21.2

Able to reproduce with other versions of react-virtualized

diogomiguel avatar Mar 12 '20 11:03 diogomiguel

so ..any update?

fnlearner avatar Nov 29 '23 07:11 fnlearner

I'm facing similar bug. Anyone has any fix for it?

devcer avatar Feb 13 '24 06:02 devcer