fix: omit cacheDimensions from img attributes in MediaImpl

This commit is contained in:
lawvs
2024-11-19 15:20:03 +08:00
parent ea8c8d0926
commit ec12b3538f
+2 -1
View File
@@ -1,5 +1,6 @@
import { nextFrame } from "@follow/utils/dom"
import { cn } from "@follow/utils/utils"
import { omit } from "es-toolkit/compat"
import { useForceUpdate } from "framer-motion"
import type { FC, ImgHTMLAttributes, VideoHTMLAttributes } from "react"
import { createContext, memo, useContext, useMemo, useState } from "react"
@@ -175,7 +176,7 @@ const MediaImpl: FC<MediaProps> = ({
<img
height={finalHeight}
width={finalWidth}
{...(rest as ImgHTMLAttributes<HTMLImageElement>)}
{...(omit(rest, "cacheDimensions") as ImgHTMLAttributes<HTMLImageElement>)}
onError={errorHandle}
className={cn(
"size-full object-contain",