React/React-Query
[React Query] 페이지네이션
React Query 에서는 페이지 정보를 포함시키는 것으로 페이지네이션을 쉽게 구현할 수 있다. 예제를 통해서 어떤 방식으로 처리하고, 어떤 특징이 있는지 알아보려 한다. 1. 코드function Component() { const [page, setPage] = useState(1); const fetchData = async (page) => { const res = await axios.get("https://rickandmortyapi.com/api/character?page=" + page); return res.data; }; const { isPending, isError, error, ..