jayspod

  • 홈
  • 태그
  • 방명록

queryClient 1

[TIL] queryClient.invalidateQueries

Problem 파이널 프로젝트 댓글 CRUD시 바로 웹사이트에 적용되지 않는 문제 Solution react-query invalidateQuery로 캐시 무효화 하여 최신 값 갱신하기 const queryClient = useQueryClient(); const deleteCommentMutation = useMutation( deleteComment, { onSuccess: () => { queryClient?.invalidateQueries(['postDetail', postId]); }, }, ); const createCommentMutation = useMutation( createComment, { onSuccess: () => { queryClient?.invalidateQueries(['..

Programming 2023.08.26
이전
1
다음
더보기
  • 분류 전체보기 (70)
    • Programming (65)
    • Review (5)
      • Spend (1)
      • Movie (1)
      • Book (2)
      • Coffee (1)

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

페이스북 트위터 플러그인

Archives

Calendar

«   2025/07   »
일 월 화 수 목 금 토
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바