λ§κ·Έλλ‘ β미리β fetch ν΄λμλ€λ건λ°..μ΄λμ μ¬μ© ν μ μμκΉ?
- pagination μμ page κ° λ°λ λ
useEffect(() => {
if (currentPage < maxPostPage) {
let nextPage = currentPage + 1;
queryClient.prefetchQuery(["posts", nextPage], () => {
fetchPosts(nextPage);
});
}
}, [currentPage, useQueryClient]);
μ΄λ°μμΌλ‘ νλ©΄..λ€μ νμ΄μ§μ κ°λλμ λ‘λ©μνκ° μμ΄μ§! μ¬μ©μ κ²½νμ΄ μ’μμ§ κ² κ°λ€.
- κ·Έλ¬λκΉ μ΄λ€ 컨ν μΈ λ₯Ό λ€μ Fetch ν΄μ΄μ΄ λͺ ν ν λ prefetch λ₯Ό μ¬μ©νλ©΄ loading μνλ₯Ό μμ¨ μ μμ΄μ μ’μ μ¬μ©μ κ²½νμ ꡬν ν μ μλ€!
- κ·Έλ¬λ μΈμ μ¨μΌν μ§λ μ κ³ λ―Όν΄μΌν λ―. 무λΆλ³νκ² μ¬μ©νλ©΄ λΆνμν μλ²μμ²μ΄ μ¦κ°ν κ²κ°λ€.
- λ§μ½ ν΄λΉ 컨ν μΈ λ₯Ό λΆλ¬μμΌνλ μν©μ΄ μλμλ prefetch λ₯Ό λ¨λ°νλ©΄?
- SSR μμλ μ¬μ©νλ κ² κ°λ€β¦ λ μμλ΄μΌν λ―?!