Comparing version 2.3.1 to 2.3.2
@@ -51,3 +51,4 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2"; | ||
var mountedRef = useRef(false); | ||
var deadlineRef = useRef(null); // =========================== Dom Node =========================== | ||
var deadlineRef = useRef(null); | ||
var destroyedRef = useRef(false); // =========================== Dom Node =========================== | ||
@@ -82,5 +83,6 @@ var cacheElementRef = useRef(null); | ||
canEnd = onLeaveEnd === null || onLeaveEnd === void 0 ? void 0 : onLeaveEnd(element, event); | ||
} | ||
} // Only update status when `canEnd` and not destroyed | ||
if (canEnd !== false) { | ||
if (canEnd !== false && !destroyedRef.current) { | ||
setStatus(STATUS_NONE); | ||
@@ -201,2 +203,3 @@ setStyle(null); | ||
clearTimeout(deadlineRef.current); | ||
destroyedRef.current = true; | ||
}; | ||
@@ -203,0 +206,0 @@ }, []); // Trigger `onVisibleChanged` |
@@ -70,3 +70,4 @@ "use strict"; | ||
var mountedRef = (0, React.useRef)(false); | ||
var deadlineRef = (0, React.useRef)(null); // =========================== Dom Node =========================== | ||
var deadlineRef = (0, React.useRef)(null); | ||
var destroyedRef = (0, React.useRef)(false); // =========================== Dom Node =========================== | ||
@@ -101,5 +102,6 @@ var cacheElementRef = (0, React.useRef)(null); | ||
canEnd = onLeaveEnd === null || onLeaveEnd === void 0 ? void 0 : onLeaveEnd(element, event); | ||
} | ||
} // Only update status when `canEnd` and not destroyed | ||
if (canEnd !== false) { | ||
if (canEnd !== false && !destroyedRef.current) { | ||
setStatus(_interface.STATUS_NONE); | ||
@@ -220,2 +222,3 @@ setStyle(null); | ||
clearTimeout(deadlineRef.current); | ||
destroyedRef.current = true; | ||
}; | ||
@@ -222,0 +225,0 @@ }, []); // Trigger `onVisibleChanged` |
{ | ||
"name": "rc-motion", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "React lifecycle controlled motion library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89208
1926