useLazyload

A hook that can lazy load resources such as image/video/audio/iframe/backgroundImage.

const [callbackRef, isLoaded] = useLazyload();

Example

Basic usage of useLazyload hook.

API

useLazyload - Result

PropertyDescriptionTypeDefault
callbackRefThe callback function for Ref(el: HTMLElement | null) => void-
isLoadedWhether the resource is loadedbooleanfalse