Breaking changes
- Changed signature to match React's camel case style, all arguments are also grouped into one,
img
can accept a string (src):
function useProgressiveImage(args: {
img?: string | { sizes?: string; src?: string; srcSet?: string; };
sources?: { sizes?: string; src?: string; srcSet?: string; type?: string; }[];
ssr?: boolean; // set to true if it's an SSR app
// returns `loading` and an `Error` event if failed to load
}): [boolean, Event | string | undefined]
Improvements
- SSR mode is now more reliable.