Skip to main content
useImage Hook
Diego Muralles avatar
Written by Diego Muralles
Updated over a week ago

Watches and returns information about an image.

Usage

const imageData: ImageModel = useImage(imageKey: string);

Relevant Interfaces

interface ImageModel {
meta?: {
description?: string;
alt?: string;
photographer: string;
width?: number;
height?: number;
};
src: string;
srcset: [string, number][];
key: string;
}

Did this answer your question?