Skip to content

Instantly share code, notes, and snippets.

View juanpprieto's full-sized avatar

Juan P. Prieto juanpprieto

View GitHub Profile
@juanpprieto
juanpprieto / Providers.tsx
Created May 9, 2024 16:15 — forked from julrich/Providers.tsx
Unpic blurhash handling with React
function isStoryblokAsset(object: unknown): object is AssetStoryblok {
return (object as AssetStoryblok)?.filename !== undefined;
}
const Picture = forwardRef<
HTMLImageElement,
PictureProps & ImgHTMLAttributes<HTMLImageElement>
>(({ src, lazy, ...props }, ref) => {
const internalRef = useRef<HTMLImageElement>(null);