Skip to content

Commit

Permalink
fix the implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
petar-i-todorov committed Jan 6, 2024
1 parent ffa816b commit 8927694
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/components/blurrable-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ export const BlurrableImage = ({
dataUrl: string
}) => {
const [isLoaded, setIsLoaded] = React.useState(false)
const imageRef = React.useRef<HTMLImageElement>(null)

React.useEffect(() => {
if (imageRef.current?.complete) {
setIsLoaded(true)
}
}, [])

return (
<>
Expand All @@ -26,6 +33,7 @@ export const BlurrableImage = ({
},
props.className,
)}
ref={imageRef}
/>
{/* it gets the alt from the props */}
{/* eslint-disable-next-line jsx-a11y/alt-text */}
Expand Down

0 comments on commit 8927694

Please sign in to comment.