Skip to content

Commit

Permalink
Use setAttribute instead of reassigning an object
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiovanacloig committed Oct 4, 2023
1 parent be4d0a2 commit 1be2a4d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions malty/atoms/Image/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export const Image = ({

const handleError = (event: React.SyntheticEvent<HTMLImageElement, Event>) => {
if (fallbackSrc) {
const newEvent = { ...event };
newEvent.currentTarget.src = fallbackSrc;
event.currentTarget.setAttribute('src', fallbackSrc);
} else {
setHasImageError(true);
}
Expand Down

0 comments on commit 1be2a4d

Please sign in to comment.