Skip to content

Feat: Week9/nonshama-m3 - #88

Open
nonshaman wants to merge 36 commits into
mainfrom
week9/nonshaman-m3
Open

Feat: Week9/nonshama-m3#88
nonshaman wants to merge 36 commits into
mainfrom
week9/nonshaman-m3

Conversation

@nonshaman

Copy link
Copy Markdown
Collaborator

📚 주차 / 미션

  • 9주차 3번째 미션

📌 작업 내용

  • redux 흔적 지우고 Zustand로 리팩토링하기

✅ 체크리스트

  • [o] 기능 정상 작동 확인
  • [o] 불필요한 주석 삭제
  • [o] 해당 주차 키워드 내용 이해

nonshaman and others added 30 commits April 12, 2026 20:51
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…an-m1

Revert 83 revert 37 week4/nonshaman m1

@yewon20804 yewon20804 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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가 실행되기 전까지 이전 값을 유지하는 상태입니다 ! 그 사이 화면이 렌더링되면 합계가 잠깐 이상하게 보일 수어 같이 초기화 하면 좋을 것 같습니다 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants