import React, { useState, type ImgHTMLAttributes } from 'react' interface LoadingImageProps extends ImgHTMLAttributes { containerClassName?: string containerStyle?: React.CSSProperties } // Image with shimmer-placeholder until loaded. Drops the shimmer once native load fires. export function LoadingImage({ containerClassName, containerStyle, className, style, onLoad, ...imgProps }: LoadingImageProps): React.ReactElement { const [loaded, setLoaded] = useState(false) return ( {!loaded && ( )} { setLoaded(true); onLoad?.(e) }} /> ) } export default LoadingImage