리액트쿼리1 [React] axios에서 React-Query로 리팩토링하기 프로젝트에서 원래 axios를 사용해서 데이터 패칭을 하고 있었다.//데이터를 서버로부터 불러오는 코드import axios from 'axios';const API_URL = import.meta.env.VITE_REACT_APP_API_URL;export const getMatchData = async (gameDate: string, gmkey: string) => { try { const res = await axios.get(`${API_URL}/game/boxscore`, { params: { gameDate, gmkey }, }); if (res.status !== 200) { throw new Error(`Failed to fetch data. Statu.. 2025. 1. 9. 이전 1 다음