Remove useless memo

This commit is contained in:
Dan Abramov
2024-11-01 01:31:49 +00:00
parent 7111e38cd4
commit c4c01955cc
+1 -8
View File
@@ -24,18 +24,11 @@ export function useImageAspectRatio({
const [raw, setAspectRatio] = React.useState<number>(
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])
React.useEffect(() => {
let aborted = false