-
Notifications
You must be signed in to change notification settings - Fork 51
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
[강나현] Week13 #478
The head ref may contain hidden characters: "part3-\uAC15\uB098\uD604-week13"
[강나현] Week13 #478
Conversation
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.
잘작성해주셨습니다!
scss로 변경하셔도 괜찮은데, 변경하신다면, 스타일드컴포넌트와 다른점 등을 생각해보시면서 변경하시면 좋을 것 같습니다. 그리고 타입의 any가 많이 선언되어있는데, 최대한 any를 줄여가보는 연습을 해보시면 좋을 것 같습니다. props의 함수가 any타입이여서 코드상으로 안전한지 판단이 안되는 부분들이 있는 것 같습니다.
최대한 연습이라고 생각해보시고 천천히 해결해나가보시면 좋을 것 같습니다
//currentFolderId가 바뀔 때마다 새로 카드리스트 업데이트 | ||
useEffect(() => { | ||
handleLoadCardList(currentFolderId); | ||
}, [currentFolderId]); |
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.
api 호출시에는 handle보단 onLoad / fetch라는 접두사가 api 호출 함수로 파악하기 쉬울 것 같습니다
setSelectedLinkUrl(link?.url ?? ""); | ||
setCurrentModal(MODALS_ID.addToFolder); | ||
}} | ||
/> |
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.
() => {} 함수보다는 어떤 동작을 하는 함수인지, 분리해서 작성해주시면, 좋을 것 같습니다
description={selectedLinkUrl} | ||
buttonText="삭제하기" | ||
onClick={() => {}} | ||
onCloseClick={closeModal} |
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.
onClick에 빈 함수가 들어가는 것 같습니다
const handleBackgroundClick = useCallback(() => { | ||
setIsPopoverOpen(false); | ||
}, []); | ||
const handleDeleteClick: MouseEventHandler<HTMLLIElement> = (event) => { |
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.
handleBackgroundClick 해당 함수 useCallback을 사용하신 이유가 있으실까요 ?
const body = await response.json(); | ||
return body; | ||
} | ||
|
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.
해당 함수들도 공통 함수로 만들어서 중복을 줄일 수 있을 것 같습니다!
<> | ||
<button className={cx(".styled_button")}>{children}</button> | ||
</> | ||
); |
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.
<>가 필요하지 않아 보입니다
요구사항
기본
주요 변경사항
스크린샷
멘토에게