Im trying to implement onError logic to my Images but when i implement it on dynamic routes it doesnt work at all.
const { src, fallbackSrc, ...rest } = props
const [imgSrc, setImgSrc] = useState(src)
return (
<Image
{...rest}
src={imgSrc}
onError={() => {
console.log("ImageWithFallback: onError: imgSrc: ", imgSrc)
setImgSrc(fallbackSrc)
}}
/>
)
}
export default ImageWithFallback
it doesnt console.log anything even though it errors
anyone has any idea why its not firing?