diff --git a/node_modules/rc-virtual-list/es/List.js b/node_modules/rc-virtual-list/es/List.js
index 6346b0d..47c327f 100644
--- a/node_modules/rc-virtual-list/es/List.js
+++ b/node_modules/rc-virtual-list/es/List.js
@@ -284,9 +284,11 @@ export function RawList(props, ref) {
componentRef.current.addEventListener('DOMMouseScroll', onFireFoxScroll);
componentRef.current.addEventListener('MozMousePixelScroll', onMozMousePixelScroll);
return function () {
- componentRef.current.removeEventListener('wheel', onRawWheel);
- componentRef.current.removeEventListener('DOMMouseScroll', onFireFoxScroll);
- componentRef.current.removeEventListener('MozMousePixelScroll', onMozMousePixelScroll);
+ if (componentRef.current) {
+ componentRef.current.removeEventListener('wheel', onRawWheel);
+ componentRef.current.removeEventListener('DOMMouseScroll', onFireFoxScroll);
+ componentRef.current.removeEventListener('MozMousePixelScroll', onMozMousePixelScroll);
+ }
};
}, [useVirtual]); // ================================= Ref ==================================
diff --git a/node_modules/rc-virtual-list/es/hooks/useMobileTouchMove.js b/node_modules/rc-virtual-list/es/hooks/useMobileTouchMove.js
index 0fdb2dd..dc4be2c 100644
--- a/node_modules/rc-virtual-list/es/hooks/useMobileTouchMove.js
+++ b/node_modules/rc-virtual-list/es/hooks/useMobileTouchMove.js
@@ -63,7 +63,9 @@ export default function useMobileTouchMove(inVirtual, listRef, callback) {
}
return function () {
- listRef.current.removeEventListener('touchstart', onTouchStart);
+ if (listRef.current) {
+ listRef.current.removeEventListener('touchstart', onTouchStart);
+ }
cleanUpEvents();
clearInterval(intervalRef.current);
};
diff --git a/node_modules/rc-virtual-list/lib/List.js b/node_modules/rc-virtual-list/lib/List.js
index 9d2d517..b6c727b 100644
--- a/node_modules/rc-virtual-list/lib/List.js
+++ b/node_modules/rc-virtual-list/lib/List.js
@@ -311,9 +311,11 @@ function RawList(props, ref) {
componentRef.current.addEventListener('DOMMouseScroll', onFireFoxScroll);
componentRef.current.addEventListener('MozMousePixelScroll', onMozMousePixelScroll);
return function () {
- componentRef.current.removeEventListener('wheel', onRawWheel);
- componentRef.current.removeEventListener('DOMMouseScroll', onFireFoxScroll);
- componentRef.current.removeEventListener('MozMousePixelScroll', onMozMousePixelScroll);
+ if (componentRef.current) {
+ componentRef.current.removeEventListener('wheel', onRawWheel);
+ componentRef.current.removeEventListener('DOMMouseScroll', onFireFoxScroll);
+ componentRef.current.removeEventListener('MozMousePixelScroll', onMozMousePixelScroll);
+ }
};
}, [useVirtual]); // ================================= Ref ==================================
diff --git a/node_modules/rc-virtual-list/lib/hooks/useMobileTouchMove.js b/node_modules/rc-virtual-list/lib/hooks/useMobileTouchMove.js
index a809897..7c20443 100644
--- a/node_modules/rc-virtual-list/lib/hooks/useMobileTouchMove.js
+++ b/node_modules/rc-virtual-list/lib/hooks/useMobileTouchMove.js
@@ -77,7 +77,9 @@ function useMobileTouchMove(inVirtual, listRef, callback) {
}
return function () {
- listRef.current.removeEventListener('touchstart', onTouchStart);
+ if (listRef.current) {
+ listRef.current.removeEventListener('touchstart', onTouchStart);
+ }
cleanUpEvents();
clearInterval(intervalRef.current);
};