-
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
Conversation
useEffect(() => { | ||
if (!error) return; | ||
setStatus(error ? ICON_STATUS.ERROR : disabled ? ICON_STATUS.DISABLE : ICON_STATUS.DEFAULT); | ||
setStatus(error ? ICON_STATUS.ERROR : ICON_STATUS.DEFAULT); | ||
}, [error, disabled]); | ||
|
||
useEffect(() => { | ||
setStatus(disabled ? ICON_STATUS.DISABLE : ICON_STATUS.DEFAULT); | ||
}, [disabled]); | ||
|
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
를 사용하는 것은 좋지 않은 패턴이라고 하네요,,!
return ( | ||
<svg width={width} height={height} fill={fill} {...rest}> | ||
<use href={`/sprite.svg#${id}`} /> | ||
</svg> | ||
); |
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.
마이너스 아이콘이 호버 효과가 반영 안되는 문제가 있어보이는데 확인해보니 minus-hover.svg
아이콘이 잘못된 것으로 보입니다! 하는 김에 수정해주시고 sprite.svg에도 반영해주시면 감사하겠습니다!
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.
🤔 파일이 잘못되었나 싶어서 re-export한다음 피그마에 띄워 이상이 없는걸 확인해보고 sprite 생성을 했었는데.. 온전히 다 삭제하고 한번 다시 봐보겠습니다~!
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
수고하셨습니다!
체크 리스트
작업 내역
문제 상황과 해결
이전 코드
변경된 코드
2.mov
비고