Remove useless memo
This commit is contained in:
@@ -24,18 +24,11 @@ export function useImageAspectRatio({
|
|||||||
const [raw, setAspectRatio] = React.useState<number>(
|
const [raw, setAspectRatio] = React.useState<number>(
|
||||||
dimensions ? calc(dimensions) : 1,
|
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 ratio = 1 / 2 // max of 1:2 ratio in feeds
|
const constrained = Math.max(raw, ratio)
|
||||||
const constrained = Math.max(raw, ratio)
|
const max = Math.max(raw, 0.25) // max of 1:4 in thread
|
||||||
const max = Math.max(raw, 0.25) // max of 1:4 in thread
|
const isCropped = raw < constrained
|
||||||
const isCropped = raw < constrained
|
|
||||||
return {
|
|
||||||
isCropped,
|
|
||||||
constrained,
|
|
||||||
max,
|
|
||||||
}
|
|
||||||
}, [raw])
|
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
let aborted = false
|
let aborted = false
|
||||||
|
|||||||
Reference in New Issue
Block a user