@j-ho/react-lazyload-image
Version:
React Image Lazy Load Component
14 lines (13 loc) • 499 B
TypeScript
import { default as React } from 'react';
interface LazyImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
placeholderSrc?: string;
threshold?: number;
}
/**
* LazyImage component (Memoized)
* - Implements image lazy loading using IntersectionObserver.
* - Wrapped with React.memo to prevent unnecessary re-renders.
* - Falls back to immediate loading if IntersectionObserver is not supported.
*/
declare const LazyImage: React.FC<LazyImageProps>;
export default LazyImage;