@shopify/react-intersection-observer
Advanced tools
Comparing version 4.0.4 to 4.1.0
@@ -44,3 +44,2 @@ 'use strict'; | ||
} | ||
const resolvedRoot = typeof root === 'string' ? document.querySelector(root) : root; | ||
@@ -61,9 +60,6 @@ const intersectionObserver = new IntersectionObserver(([entry]) => setIntersectingEntry(entry), { | ||
} | ||
lastNode.current = node.current; | ||
if (node.current == null) { | ||
return; | ||
} | ||
if (!utilities.isSupported() && unsupportedBehavior === types.UnsupportedBehavior.TreatAsIntersecting) { | ||
@@ -82,3 +78,2 @@ const boundingClientRect = node.current.getBoundingClientRect(); | ||
} | ||
if (observer.current != null) { | ||
@@ -88,3 +83,2 @@ lastObserver.current = observer.current; | ||
} | ||
return () => { | ||
@@ -94,3 +88,2 @@ if (lastNode.current == null || lastObserver.current == null || lastNode.current === node.current && lastObserver.current === observer.current) { | ||
} | ||
lastObserver.current.unobserve(lastNode.current); | ||
@@ -97,0 +90,0 @@ }; |
@@ -6,3 +6,2 @@ 'use strict'; | ||
exports.UnsupportedBehavior = void 0; | ||
(function (UnsupportedBehavior) { | ||
@@ -9,0 +8,0 @@ UnsupportedBehavior[UnsupportedBehavior["Ignore"] = 0] = "Ignore"; |
{ | ||
"name": "@shopify/react-intersection-observer", | ||
"version": "4.0.4", | ||
"version": "4.1.0", | ||
"license": "MIT", | ||
@@ -24,3 +24,3 @@ "description": "A React wrapper around the Intersection Observer API", | ||
"engines": { | ||
"node": "^14.17.0 || >=16.0.0" | ||
"node": ">=18.12.0" | ||
}, | ||
@@ -36,7 +36,7 @@ "files": [ | ||
"peerDependencies": { | ||
"react": ">=16.8.0 <19.0.0" | ||
"react": ">=18.0.0 <19.0.0" | ||
}, | ||
"devDependencies": { | ||
"@shopify/jest-dom-mocks": "^4.1.2", | ||
"@shopify/react-testing": "^5.1.2" | ||
"@shopify/jest-dom-mocks": "^5.1.0", | ||
"@shopify/react-testing": "^5.3.0" | ||
}, | ||
@@ -43,0 +43,0 @@ "module": "index.mjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
23057