1.4.0 • Published 1 year ago
@arcteryx/components-hooks v1.4.0
components-hooks
Hooks that are used across our repos.
Usage
useIntersectionObserver
import { useIntersectionObserver } from "@arcteryx/components-hooks";
const ProductTileWrapper = ({ product }) => {
useIntersectionObserver({
target: ref,
deps: [product.id],
rootMargin: "600px",
onIntersect: ([{ isIntersecting }], observerElement) => {
if (isIntersecting) {
lazyloadProduct();
if (observerElement && ref.current) {
observerElement.unobserve(ref.current);
}
}
},
});
return (
<ProductTile product={product} />
);
};
1.4.0
1 year ago
1.4.0-gamma.0
1 year ago
1.4.0-ts2.0
1 year ago
1.4.0-test.0
1 year ago
1.4.0-ts.0
1 year ago
1.4.0-alpha.0
1 year ago
1.3.2-alpha.0
1 year ago
1.3.1
2 years ago
1.3.0
2 years ago
1.2.0
3 years ago
1.1.0
3 years ago