Skip to content

[refactor] match 리스트 컴포넌트 렌더링 최적화#44

Merged
tnemnorivnelee merged 3 commits into
developfrom
refactor/match-list-rendering-optimization
Jan 22, 2026
Merged

[refactor] match 리스트 컴포넌트 렌더링 최적화#44
tnemnorivnelee merged 3 commits into
developfrom
refactor/match-list-rendering-optimization

Conversation

@tnemnorivnelee

Copy link
Copy Markdown
Contributor

🔗 관련 이슈

Resolves: #43

📝 작업 내용

  • MatchHistoryList.tsx: renderItem을 useCallback으로 감싸고, ItemSeparatorComponent를 외부 함수로 분리
  • MatchHistoryListItem.tsx: React.memo 적용

📷 스크린샷 (UI 작업인 경우)

N/A (렌더링 최적화로 UI 변경 없음)

💬 리뷰어에게

왜 이 작업을 했나요?

useCallback이나 React.memo는 무조건 좋은 게 아닙니다.
메모이제이션 자체도 비용(메모리 저장, 비교 연산)이 발생하기 때문에,
리렌더 방지 이득 > 메모이제이션 비용일 때만 사용해야 합니다.

하지만 FlatList는 예외입니다.
React Native 공식적으로 renderItem에 안정적인 함수 참조를 권장하고,
리스트 아이템이 많아질수록 인라인 함수로 인한 불필요한 리렌더 비용이 커지기 때문입니다.

적용한 최적화

적용 효과
useCallback renderItem 함수 참조 안정화
React.memo props 변경 없으면 리스트 아이템 리렌더 방지

chat 기능과 패턴 일관성을 위해 match에도 동일하게 적용했습니다.

✅ 기본 체크리스트

  • 코드가 정상적으로 실행되나요? (yarn start 빌드 에러 없음)
  • (중요) 안드로이드/iOS 시뮬레이터에서 각각 확인했나요?
  • 불필요한 console.log나 주석을 제거했나요?
  • yarn format을 실행하여 코드 스타일을 정렬했나요?
  • yarn lint를 실행하여 린트 에러가 없나요?

🏗️ 구조 체크리스트 (Self-Check)

파일 및 폴더

  • 1개 기능 전용 컴포넌트features/ 안에 두었나요? (❌ shared/ui 금지)
  • 재사용 컴포넌트shared/ui에 두었나요?
  • 파일이 3개 이상일 때만 폴더로 묶었나요? (불필요한 index.ts 방지)

상태 관리 & 네이밍

  • 서버 데이터는 React Query, UI 상태는 Zustand를 사용했나요?
  • Boolean 변수is, has, should로 시작하나요?

Copilot AI review requested due to automatic review settings January 16, 2026 19:33
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @tnemnorivnelee, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 매치 리스트 컴포넌트의 렌더링 성능을 최적화하는 것을 목표로 합니다. FlatList 사용 시 발생할 수 있는 불필요한 리렌더링을 줄여, 특히 리스트 아이템이 많아질 때 사용자 경험을 개선하고 애플리케이션의 효율성을 높였습니다. 이는 React Native 공식 권장 사항을 따르고, 기존 채팅 기능과의 일관성을 유지하기 위함입니다.

Highlights

  • 렌더링 최적화 적용: MatchHistoryList.tsx 파일에서 renderItem 함수를 useCallback으로 감싸고, ItemSeparatorComponent를 외부 함수로 분리하여 렌더링 안정성을 확보했습니다.
  • 컴포넌트 메모이제이션: MatchHistoryListItem.tsx 컴포넌트에 React.memo를 적용하여 props 변경이 없을 시 불필요한 리렌더링을 방지했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

안녕하세요. 매칭 내역 리스트의 렌더링 최적화 작업을 해주셨네요. FlatList의 성능 특성을 잘 이해하고 useCallbackReact.memo를 적절히 활용하여 최적화를 진행한 점이 인상적입니다. PR 설명에 메모이제이션의 비용과 이점에 대해 명확히 정리해주셔서 리뷰어가 의도를 파악하기 좋았습니다.

한 가지 추가적인 개선 제안을 MatchHistoryList.tsx 파일에 남겼습니다. renderItem 함수를 컴포넌트 외부로 추출하여 useCallback 훅 없이도 안정적인 참조를 유지하는 방법에 대한 내용입니다.

전반적으로 깔끔하고 목적이 뚜렷한 좋은 리팩터링이라고 생각합니다. 수고하셨습니다!

Comment thread src/features/match/components/MatchHistoryList.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

이 PR은 FlatList 렌더링 최적화를 위해 MatchHistoryListMatchHistoryListItem 컴포넌트에 메모이제이션을 적용합니다. React Native의 FlatList는 리스트 아이템이 많을 때 렌더링 성능에 민감하므로, 콜백 함수 참조 안정화와 컴포넌트 메모이제이션이 효과적입니다.

Changes:

  • renderItem 함수를 useCallback으로 감싸 함수 참조 안정화
  • ItemSeparatorComponent를 컴포넌트 외부 함수로 분리하여 재생성 방지
  • MatchHistoryListItemReact.memo 적용으로 불필요한 리렌더 방지

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/features/match/components/MatchHistoryList.tsx renderItemItemSeparatorComponent를 메모이제이션하여 FlatList 렌더링 최적화
src/features/match/components/MatchHistoryListItem.tsx React.memo를 적용하여 props 변경 시에만 리렌더되도록 개선

Comment thread src/features/match/components/MatchHistoryList.tsx

@Yeram9286 Yeram9286 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

고생하셨습니다!

…nto refactor/match-list-rendering-optimization

@soyeoung1 soyeoung1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

고생하셨습니다!

@tnemnorivnelee tnemnorivnelee merged commit a56e985 into develop Jan 22, 2026
2 checks passed
@tnemnorivnelee tnemnorivnelee deleted the refactor/match-list-rendering-optimization branch January 22, 2026 05:47
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.

[refactor] match 리스트 컴포넌트 렌더링 최적화

4 participants