Skip to content

[meal] 달력 메뉴 줄 key 중복 경고 수정 - #94

Merged
g-hyxn merged 1 commit into
developfrom
fix/meal-calendar-duplicate-key
Jul 4, 2026
Merged

g-hyxn merged 1 commit into
developfrom
fix/meal-calendar-duplicate-key

Conversation

@g-hyxn

@g-hyxn g-hyxn commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

💡 PR 요약

  • 식단 관리 달력에서 같은 식단에 동일한 메뉴 줄이 중복 입력된 경우 React key 중복 경고가 발생하던 문제를 수정하였습니다.

📋 작업 내용

  • MealMonthGrid에서 메뉴 줄을 렌더링할 때 줄 내용(line)을 그대로 key로 사용하고 있어, 한 식단 설명에 같은 줄이 두 번 들어가면 Encountered two children with the same key 경고가 발생하고 중복 줄이 누락될 수 있었습니다.
  • key를 `${index}-${line}` 형태로 변경하여 중복 메뉴 줄에서도 key가 충돌하지 않도록 하였습니다.

🤝 리뷰 시 참고사항

  • 메뉴 줄 목록은 항목 순서가 재배열되지 않고 항상 통째로 다시 그려지므로 index 기반 key로 충분합니다.

@g-hyxn g-hyxn added the bug Something isn't working label Jul 4, 2026
@vercel

vercel Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hororog Ready Ready Preview, Comment Jul 4, 2026 4:09pm

@g-hyxn g-hyxn self-assigned this Jul 4, 2026
@g-hyxn
g-hyxn force-pushed the fix/meal-calendar-duplicate-key branch from 5ca3fe4 to 512c0da Compare July 4, 2026 16:08
@g-hyxn
g-hyxn merged commit d2121fd into develop Jul 4, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 512c0da1 Deployed Jul 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant