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

[Fix] Transition 버벅임 문제 해결 #177

Merged
merged 4 commits into from
Aug 20, 2024
Merged

Conversation

jhj2713
Copy link
Member

@jhj2713 jhj2713 commented Aug 20, 2024

🖥️ Preview

as-is

2024-08-20.10.55.15.mov

to-be

2024-08-20.11.33.39.mov

close #176

✏️ 한 일

  • 무한 Transition 개선

❗️ 발생한 이슈 (해결 방안)

기존에 사용했던 사용해서 visibleCardCount * 2만큼 렌더링 후 리스트 목록을 갈아끼우는 방식이 불필요한 렌더링을 유발하고 목록을 갈아끼우는 과정에서 버벅임이 발생하는 문제가 있었습니다.

따라서 배열을 갈아끼우지 않고 화면에 보이는 카드들만 렌더링할 수 있도록 Windowing 방식을 수정했습니다. >> 관련 wiki

❓ 논의가 필요한 사항

@jhj2713 jhj2713 added the fix 버그가 발생 label Aug 20, 2024
@jhj2713 jhj2713 requested a review from sooyeoniya August 20, 2024 02:45
@jhj2713 jhj2713 self-assigned this Aug 20, 2024
Copy link

빌드를 성공했습니다! 🎉

Copy link

빌드를 성공했습니다! 🎉

<TransitionCasperCardItem
key={`${card.id}-${idx}`}
Copy link
Member Author

Choose a reason for hiding this comment

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

key에 index까지 추가해두면 배열에 새로운 카드가 추가될 때마다 key값이 바껴서 모든 배열이 리렌더링이 발생해서 idx는 삭제,,

Copy link
Member

@sooyeoniya sooyeoniya left a comment

Choose a reason for hiding this comment

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

어제 이것때문에 골머리 아팠는데 해결해서 정말 다행이네요!! 멋있습니다 👍🏻

@sooyeoniya sooyeoniya merged commit d250c3e into dev Aug 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix 버그가 발생
Projects
None yet
Development

Successfully merging this pull request may close these issues.

무한 Transition 애니메이션 버벅임 문제
2 participants