React Query(지금은 Tanstack Query가 공식 명칭이지만 React Query로 부르는게 익숙해졌다💦)로 조건부 query를 할 수 있는 방법을 알아본다. 우리 프로젝트에서 사용하는 react query를 이용한 API 훅 프로젝트에서 사용한 useQuery문의 예시이다. 요약하자면 axios의 get 함수를 정의한 getCheckNotification 함수로 useQuery문을 작성한 뒤, 훅으로 빼뒀다. // api/notification.ts import { useQuery } from "@tanstack/react-query"; // api 함수 const getCheckNotification = async () => { const response = await axios.get(..