@radix-ui/react-avatar
Advanced tools
Comparing version 1.1.0 to 1.1.1-rc.1
@@ -76,3 +76,3 @@ "use strict"; | ||
const context = useAvatarContext(IMAGE_NAME, __scopeAvatar); | ||
const imageLoadingStatus = useImageLoadingStatus(src); | ||
const imageLoadingStatus = useImageLoadingStatus(src, imageProps.referrerPolicy); | ||
const handleLoadingStatusChange = (0, import_react_use_callback_ref.useCallbackRef)((status) => { | ||
@@ -107,3 +107,3 @@ onLoadingStatusChange(status); | ||
AvatarFallback.displayName = FALLBACK_NAME; | ||
function useImageLoadingStatus(src) { | ||
function useImageLoadingStatus(src, referrerPolicy) { | ||
const [loadingStatus, setLoadingStatus] = React.useState("idle"); | ||
@@ -125,6 +125,9 @@ (0, import_react_use_layout_effect.useLayoutEffect)(() => { | ||
image.src = src; | ||
if (referrerPolicy) { | ||
image.referrerPolicy = referrerPolicy; | ||
} | ||
return () => { | ||
isMounted = false; | ||
}; | ||
}, [src]); | ||
}, [src, referrerPolicy]); | ||
return loadingStatus; | ||
@@ -131,0 +134,0 @@ } |
{ | ||
"name": "@radix-ui/react-avatar", | ||
"version": "1.1.0", | ||
"version": "1.1.1-rc.1", | ||
"license": "MIT", | ||
@@ -57,3 +57,4 @@ "exports": { | ||
"url": "https://github.com/radix-ui/primitives/issues" | ||
} | ||
}, | ||
"stableVersion": "1.1.0" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
30400
266
0
1