From 76ef60308b0955841ffdc3681f43d7370541937e Mon Sep 17 00:00:00 2001 From: Byran Low Date: Wed, 31 May 2023 13:54:07 +1000 Subject: [PATCH] fallback to prop sizes if not defined --- src/Image.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Image.tsx b/src/Image.tsx index eee843b..ff8ea40 100644 --- a/src/Image.tsx +++ b/src/Image.tsx @@ -89,7 +89,7 @@ export const Image: React.FC = ({force, options, ...props}) => { } const strippedSrc = props.src.replace(/^\/|\/$/g, '') const src = getImageSrc(strippedSrc, options) - const sizes = options?.widths ? getSizes(options.widths, options.maxWidth ?? (options.width ? Math.max(options.width, ...options.widths) : Math.max(...options.widths))) : '' + const sizes = options?.widths ? getSizes(options.widths, options.maxWidth ?? (options.width ? Math.max(options.width, ...options.widths) : Math.max(...options.widths))) : props.sizes const srcSet = getSrcSets(strippedSrc, options) return }