-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature/FE-052 : IconButton disabled 에러 수정 #71
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { SVGProps } from 'react'; | ||
|
||
interface Props extends SVGProps<SVGSVGElement> { | ||
/** icon id (spriteIcons 폴더하에 있는 svg 파일명과 동일함) */ | ||
id: string; | ||
/** icon id (spriteIcons 폴더하에 있는 svg 파일명과 동일함) */ | ||
id: string; | ||
} | ||
|
||
const SvgIcon = ({ id, width = 16, height = 16, fill = 'none', ...rest }: Props) => { | ||
return ( | ||
<svg width={width} height={height} fill={fill} {...rest}> | ||
<use href={`/sprite.svg#${id}`} /> | ||
</svg> | ||
); | ||
return ( | ||
<svg width={width} height={height} fill={fill} {...rest}> | ||
<use href={`/sprite.svg#${id}`} /> | ||
</svg> | ||
); | ||
Comment on lines
+9
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 마이너스 아이콘이 호버 효과가 반영 안되는 문제가 있어보이는데 확인해보니 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 파일이 잘못되었나 싶어서 re-export한다음 피그마에 띄워 이상이 없는걸 확인해보고 sprite 생성을 했었는데.. 온전히 다 삭제하고 한번 다시 봐보겠습니다~! |
||
}; | ||
|
||
export default SvgIcon; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IconButton
내에서useEffect
가 많아져서 로직 파악이 어려워지고 있는 것 같아요..!나중에 기회될때
useEffect
를 없애는 방향으로 리팩토링 진행해보면 좋을 것 같아요~state
와props
에 변화에 대응하기 위해useEffect
를 사용하는 것은 좋지 않은 패턴이라고 하네요,,!