Skip to content

Commit

Permalink
fix: icon 컴포넌트 이벤트 핸들러 서버컴포넌트 호환성 문제
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-yn committed Nov 10, 2023
1 parent ee394d2 commit 8360153
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/composable/Icon/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Image, { ImageProps } from 'next/image';
import React, { useRef } from 'react';
import React from 'react';
import { ASSET_ENDPOINT } from '@/const/endpoint';
import iconResourceSrcFormat from '@/utils/string/iconResourceSrcFormat';

Expand All @@ -17,8 +17,6 @@ const Icon = ({
format,
...props
}: Props) => {
const imageRef = useRef<HTMLImageElement>(null);

const resource = iconResourceSrcFormat({
company,
color,
Expand All @@ -31,12 +29,11 @@ const Icon = ({
return (
<Image
{...props}
ref={imageRef}
src={`${path}/${resource}.${format || 'png'}`}
onError={(e) => {
const target = e.target as HTMLImageElement;
target.style.opacity = '0';
}}
// onError={(e) => {
// const target = e.target as HTMLImageElement;
// target.style.opacity = '0';
// }}
alt={company}
/>
);
Expand Down

0 comments on commit 8360153

Please sign in to comment.