Feat: Week9/nonshama-m3 - #88
Open
nonshaman wants to merge 36 commits into
Open
Conversation
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Revert 37 week4/nonshaman m1
…an-m1 Revert 83 revert 37 week4/nonshaman m1
Feat: Week4/nonshaman-m2
Feat: Week4/nonshaman m3
Week5/nonshaman-m1
Week5/nonshaman-m2
Week5/nonshaman-m3
Feat: Week6/nonshaman-m1
Feat: Week6/nonshaman-m2
Feat: Week7/nonshaman-m1
Feat: Week7/nonshaman-m2
Feat: Week8/nonshaman-m1
Feat: Week8/nonshaman-m2
Feat: Week8/nonshaman-m3
yewon20804
reviewed
Jun 2, 2026
yewon20804
left a comment
Collaborator
There was a problem hiding this comment.
9주차 미션 3도 수고하셨습니다 !! 전반적으로 Zustand 패턴을 잘 적용해주셨습니다 👍
아래 코멘트 하나 확인 부탁드립니다 :)
1. useCartStore.ts — clearCart 실행 후 amount / total 값이 잠깐 남아있는 문제
// ❌ 현재 — cartItems만 초기화
clearCart: () => {
set((state) => {
state.cartItems = [];
});
},
// ✅ 수정 — amount, total도 같이 초기화
clearCart: () => {
set((state) => {
state.cartItems = [];
state.amount = 0;
state.total = 0;
});
},
clearCart를 호출하면 cartItems는 바로 []가 되지만, amount와 total은 Navbar의 useEffect가 실행되기 전까지 이전 값을 유지하는 상태입니다 ! 그 사이 화면이 렌더링되면 합계가 잠깐 이상하게 보일 수어 같이 초기화 하면 좋을 것 같습니다 !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📚 주차 / 미션
📌 작업 내용
✅ 체크리스트