react-ronin
Advanced tools
Comparing version 2.0.3-image-component-experimental.5 to 2.0.3-image-component-experimental.6
@@ -100,3 +100,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const Image = ({ src: input, alt, size: defaultSize, width: defaultWidth, height: defaultHeight, quality, loading })=>{ | ||
const imageRef = react.useRef(null); | ||
const imageElement = react.useRef(null); | ||
const renderTime = react.useRef(Date.now()); | ||
@@ -130,3 +130,3 @@ const isMediaObject = typeof input === "object" && input !== null; | ||
const placeholder = input && typeof input !== "string" ? input.placeholder?.base64 : null; | ||
const onLoad = ()=>{ | ||
const onLoad = react.useCallback(()=>{ | ||
const duration = Date.now() - renderTime.current; | ||
@@ -137,3 +137,3 @@ const threshold = 150; | ||
if (duration > threshold) { | ||
imageRef.current?.animate([ | ||
imageElement.current?.animate([ | ||
{ | ||
@@ -151,3 +151,6 @@ filter: "blur(4px)", | ||
} | ||
}; | ||
}, [ | ||
renderTime.current, | ||
imageElement.current | ||
]); | ||
return /*#__PURE__*/ jsxRuntime.jsxs("div", { | ||
@@ -182,3 +185,3 @@ style: { | ||
loading: loading, | ||
ref: imageRef, | ||
ref: imageElement, | ||
src: source, | ||
@@ -185,0 +188,0 @@ srcSet: responsiveSource |
{ | ||
"name": "react-ronin", | ||
"version": "2.0.3-image-component-experimental.5", | ||
"version": "2.0.3-image-component-experimental.6", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
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
34251
465