Skip to content

Commit

Permalink
set ref initial value to always null
Browse files Browse the repository at this point in the history
Co-authored-by: Chance Strickland <[email protected]>
  • Loading branch information
rkkautsar and chaance authored Nov 2, 2024
1 parent 375638d commit b65216b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react/avatar/src/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function resolveLoadingStatus(image: HTMLImageElement | null, src?: string): Ima

function useImageLoadingStatus(src?: string, referrerPolicy?: React.HTMLAttributeReferrerPolicy) {
const isHydrated = useIsHydrated()
const image = React.useRef(isHydrated ? new window.Image() : null);
const image = React.useRef<HTMLImageElement | null>(null);
const img = (() => {
if (!isHydrated) return null;
if (!image.current) {
Expand Down

0 comments on commit b65216b

Please sign in to comment.