Skip to content

feat: [TA-276] react-query 도입 — 데이터 패칭 캐시/중복제거 - #154

Merged
seorinn merged 1 commit into
developfrom
TA-276-react-query
Jun 30, 2026
Merged

seorinn merged 1 commit into
developfrom
TA-276-react-query

Conversation

@seorinn

@seorinn seorinn commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

변경 사항

  • @tanstack/react-query(v5) 도입, 루트에 QueryClientProvider(retry:false, refetchOnWindowFocus:false, staleTime:0)
  • usePromotionList/usePhotographerList를 useQuery로 이관(공개 반환 형태 유지 → 소비처 무변경)
  • 테스트 인프라: renderWithProviders + 훅 테스트에 QueryClientProvider 래퍼

효과

  • queryKey=[name, params]로 필터별 캐시 + 동일 요청 dedupe
  • staleTime:0 → 재방문 시 캐시 즉시 표시(스켈레톤 깜빡임 제거) + 백그라운드 재검증으로 최신 반영
  • StrictMode/연속 필터 변경 시 오래된 응답 무시(기존 cancelled 가드 대체)

동등성

  • isLoading: enabled시 첫 로딩 true, enabled=false시 false / error: message 또는 기본문구(빈 문자열도 ||로 기본 처리) / 기본 []
  • 소비처 컴포넌트 테스트는 훅을 mock해 영향 없음

검증

  • tsc·전체 테스트(42 suites/181 tests, CI에서 jest 포함)·build 통과
  • Opus 리뷰 반영: staleTime 30s→0(저장/신규 즉시 반영), 빈 message || 처리, '취소' 워딩 정정

후속(별도)

  • mutation(저장/생성) 후 invalidateQueries 연동
  • 진짜 HTTP 취소: axios signal 배선(현재 GET 미지원)
  • 상세/MyPage 등 추가 이관

Closes TA-276

@vercel

vercel Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
damaba Ready Ready Preview, Comment Jun 30, 2026 5:39am

@seorinn
seorinn marked this pull request as ready for review June 30, 2026 05:40
@seorinn
seorinn merged commit 5af969a into develop Jun 30, 2026
3 checks passed
@seorinn
seorinn deleted the TA-276-react-query branch June 30, 2026 05:40

This branch was successfully deployed

1 active deployment
Preview — 28b64482 Deployed Jun 30, 2026 by vercel[bot]
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.

1 participant