Skip to content
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

refactor: 프로필 페이지 코드 리팩토링 #376

Merged
merged 24 commits into from
Apr 30, 2024
Merged

Conversation

presentKey
Copy link
Collaborator

@presentKey presentKey commented Apr 30, 2024

📝 개요

  • 컴포넌트 및 비지니스 로직 관심사 분리
  • 리렌더링 성능 개선

🚀 변경사항

TabMenu 컴포넌트 예시

useTabMenu 훅 내부에서 UI 로직데이터 fetch 로직이 함께 있었습니다. 이로 인해 컴포넌트가 복잡하고 불필요한 렌더링이 발생했습니다.

이 문제를 개선하기 위해 비즈니스 로직을 관심사에 따라 적절히 분산하고, 관련있는 컴포넌트 내부로 UI와 로직을 재배치했습니다.

개선 전 개선 후
분리 전 분리 후

Stat 컴포넌트 리렌더링 개선

↓ 개선 전 영상

Stat.mp4

↓ 개선 후 영상

Stat.mp4

프로필 페이지 리뷰 좋아요 토글 시, 리렌더링 개선

개선 전 개선 후
image image
  • 개선 전

    • render: 11.6ms
    • 변경이 발생하지 않은 모든 review card 리렌더링
  • 개선 후

    • render: 2.5ms
    • 변경이 발생한 review card만 리렌더링

↓ 개선 전 영상

ContentList.mp4

↓ 개선 후 영상

ContentList.mp4

🔗 관련 이슈

#375

➕ 기타

@presentKey presentKey added the refactor 리팩토링 label Apr 30, 2024
@presentKey presentKey requested review from imdaxsz and chanwukim April 30, 2024 09:25
@presentKey presentKey self-assigned this Apr 30, 2024
@chanwukim
Copy link
Contributor

프로필 페이지 리뷰 좋아요 토글 시, 리렌더링 개선 여기가 인상적이네요 👀 잘 참고해보고 배우겠습니다

@presentKey presentKey merged commit 41da3d7 into develop Apr 30, 2024
2 checks passed
@presentKey presentKey deleted the refactor/375 branch April 30, 2024 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor 리팩토링
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants