From 1be2a4df470dfd4bd5683887097223da228adb50 Mon Sep 17 00:00:00 2001 From: Sergio Vanacloig Date: Wed, 4 Oct 2023 09:58:00 +0200 Subject: [PATCH] Use setAttribute instead of reassigning an object --- malty/atoms/Image/Image.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/malty/atoms/Image/Image.tsx b/malty/atoms/Image/Image.tsx index 1edd9bae3..8e42bf2f3 100644 --- a/malty/atoms/Image/Image.tsx +++ b/malty/atoms/Image/Image.tsx @@ -27,8 +27,7 @@ export const Image = ({ const handleError = (event: React.SyntheticEvent) => { if (fallbackSrc) { - const newEvent = { ...event }; - newEvent.currentTarget.src = fallbackSrc; + event.currentTarget.setAttribute('src', fallbackSrc); } else { setHasImageError(true); }