-
Notifications
You must be signed in to change notification settings - Fork 5
Feature/my-profile api 연결 및 무한 스크롤 훅 생성 #77
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
next.config.js
Outdated
|
|
||
| images: { | ||
| domains: ['sprint-fe-project.s3.ap-northeast-2.amazonaws.com'], | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앗 위에 설정이 되어 있는데 혹시 안되서 따로 추가하신 건가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 성주님께서 추가한신지 모르고 따로 추가했던 걸 그대로 올렸어용 ㅋㅋ 머지 전에 삭제하겠습니다!
| hasNextPage: !!hasNextPage, | ||
| fetchNextPage, | ||
| isFetching: isFetchingNextPage, | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
인피니티 쿼리를 쓰면 이렇게 쓰는 거군요.
패칭함수를 따로 콜백으로 넘겨줘야할 것 같다고 생각하고 있었는데
인피티니 쿼리랑 같이 쓰니까 간결하고 좋네요
📦 Pull Request
중간에 분리를 했어야했는데.. 급하게 하다보니
길어졌습니다 죄송합니다 ㅠㅠ
📝 요약(Summary)
리스트 API 연동
getMyReviews,getMyWinesAPI 연동TanStack Query기반useInfiniteQuery로 데이터 무한 패칭 구현MyReviewsResponse,MyWinesResponse정의MyProfile 페이지 수정
내가 쓴 후기 / 내가 등록한 와인)에 따라 API 데이터 패칭TabNav에서 각 탭별 totalCount를 반영하여 개수 출력무한스크롤 훅 작성 및 적용
useInfiniteScroll훅 작성→ IntersectionObserver 기반
→
hasNextPage,isFetching,fetchNextPage조건 처리ReviewList,WineList컴포넌트에 적용하여 페이징 자동 처리useInfiniteQuery에 좀 더 알고 싶으시면 해당 블로그 글을 읽어보시길 추천드립니다
💬 공유사항 to 리뷰어
useInfiniteScroll훅은 타 컴포넌트에서도 재사용 가능한 구조로 작성했습니다.ref로 명시해야 하며, 리스트 마지막에<div ref={observerElement} />로 부착했습니다.totalCount는 첫 페이지 패칭 이후useEffect를 통해 상위TabNav로 전달하고 있습니다.무한스크롤 훅 사용법
🗂️ 관련 이슈
#67
#66
📸 스크린샷
2025-07-29.150726.mp4
2025-07-29.150817.mp4
Todo
✅ 체크리스트