From c4c01955cc3fdb7590204ab071403a39ce05236b Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 1 Nov 2024 01:31:49 +0000 Subject: [PATCH] Remove useless memo --- src/view/com/util/images/AutoSizedImage.tsx | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/view/com/util/images/AutoSizedImage.tsx b/src/view/com/util/images/AutoSizedImage.tsx index a9bfc1c966..fe101fae6b 100644 --- a/src/view/com/util/images/AutoSizedImage.tsx +++ b/src/view/com/util/images/AutoSizedImage.tsx @@ -24,18 +24,11 @@ export function useImageAspectRatio({ const [raw, setAspectRatio] = React.useState( dimensions ? calc(dimensions) : 1, ) - // this basically controls the width of the image - const {isCropped, constrained, max} = React.useMemo(() => { - const ratio = 1 / 2 // max of 1:2 ratio in feeds - const constrained = Math.max(raw, ratio) - const max = Math.max(raw, 0.25) // max of 1:4 in thread - const isCropped = raw < constrained - return { - isCropped, - constrained, - max, - } - }, [raw]) + + const ratio = 1 / 2 // max of 1:2 ratio in feeds + const constrained = Math.max(raw, ratio) + const max = Math.max(raw, 0.25) // max of 1:4 in thread + const isCropped = raw < constrained React.useEffect(() => { let aborted = false