let's get IT with DAVINA ๐Ÿ’ป

React Query ๋ณธ๋ฌธ

DEV_IN/React

React Query

๋‹ค๋นˆ์น˜์ฝ”๋“œ๐Ÿ’Ž 2023. 3. 24. 22:22

โœ๏ธ  ์‚ฌ์ „ Knowledge ++

FE ์ƒํƒœ ๊ด€๋ฆฌ

  • redux, mobx, recoil ๋“ฑ ๋‹ค์–‘ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์กด์žฌ
์ƒํƒœ๋ž€?
์ฃผ์–ด์ง„ ์‹œ๊ฐ„์— ๋Œ€ํ•ด ์‹œ์Šคํ…œ์„ ๋‚˜ํƒ€๋‚ด๋Š” ๊ฒƒ์œผ๋กœ ์–ธ์ œ๋“ ์ง€ ๋ณ€๊ฒฝ๋  ์ˆ˜ ์žˆ์Œ.
์ฆ‰, ๋ฌธ์ž์—ด, ๋ฐฐ์—ด, ๊ฐ์ฒด ๋“ฑ์˜ ํ˜•ํƒœ๋กœ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์— ์ €์žฅ๋œ ๋ฐ์ดํ„ฐ → ๊ฐœ๋ฐœ์ž ์ž…์žฅ์—์„œ๋Š” ๊ด€๋ฆฌํ•ด์•ผํ•˜๋Š” ๋ฐ์ดํ„ฐ๋“ค
์ƒํƒœ๊ด€๋ฆฌ?
์‹œ๊ฐ„์˜ ํ๋ฆ„์— ๋”ฐ๋ผ ๋ณ€ํ™”ํ•˜๋Š” ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ๊ฒƒ
React์—์„  ๋‹จ๋ฐฉํ–ฅ ๋ฐ”์ธ๋”ฉ์ด๋ฏ€๋กœ props drilling ์ด์Šˆ๋„ ์กด์žฌ (redux, mobx์™€ ๊ฐ™์€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•ด์„œ ํ•ด๊ฒฐํ•˜๊ธฐ๋„ ํ•จ)
  • store์€ ์ „์—ญ์ƒํƒœ๊ฐ€ ์ €์žฅ๋˜๊ณ  ๊ด€๋ฆฌ๋˜๋Š” ๊ณต๊ฐ„์ธ๋ฐ redux, redux-saga๋ฐฉ์‹์œผ๋กœ ๋น„๋™๊ธฐ ์š”์ฒญ์„ ๊ตฌํ˜„ํ•˜๊ฒŒ ๋˜๋ฉด redux ๊ตฌํ˜„ํ•˜๋Š” ๋ชจ๋“ˆ์— APIํ†ต์‹  ๊ด€๋ จ ์ฝ”๋“œ๊ฐ€ ๋Œ€๋ถ€๋ถ„์ด๊ฒŒ ๋จ
  • ๋น„์Šทํ•œ ๊ตฌ์กฐ์˜ API ํ†ต์‹  ์ฝ”๋“œ ๋ฐ˜๋ณต (loading, error, fetching ๋“ฑ)

์„œ๋ฒ„์—์„œ ๋ฐ›์•„์•ผ ํ•˜๋Š” ์ƒํƒœ๋“ค์˜ ํŠน์„ฑ

  • client์—์„œ ์ œ์–ดํ•˜๊ฑฐ๋‚˜ ์†Œ์œ ๋˜์ง€ ์•Š์€ ์›๊ฒฉ์˜ ๊ณต๊ฐ„์—์„œ ๊ด€๋ฆฌ๋˜๊ณ  ์œ ์ง€๋จ
  • fetching์ด๋‚˜ updating์— ๋น„๋™๊ธฐ API๊ฐ€ ํ•„์š”ํ•จ
  • ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค๊ณผ ๊ณต์œ ๋˜๋Š” ๊ฒƒ์œผ๋กœ ์‚ฌ์šฉ์ž๊ฐ€ ๋ชจ๋ฅด๋Š” ์‚ฌ์ด์— ๋ณ€๊ฒฝ๋  ์ˆ˜ ์žˆ์Œ
  • ์‹ ๊ฒฝ์“ฐ์ง€ ์•Š๋Š”๋‹ค๋ฉด ์ž ์žฌ์ ์œผ๋กœ "out of dated"๊ฐ€ ๋  ์ˆ˜ ์žˆ์Œ..
  • ์‚ฌ์‹ค์ƒ FE์—์„œ ์ด ๊ฐ’๋“ค์ด ์ €์žฅ๋˜์–ด์žˆ๋Š” state๋“ค์€ ์ผ์ข…์˜ ์บ์‹œ

Client State vs Server State

  • ์ƒํƒœ๋ฅผ ํฌ๊ฒŒ Client State ์™€ Server State๋กœ ๊ตฌ๋ถ„ ๊ฐ€๋Šฅ
  • key point๋Š” Ownership์ด ์žˆ๋Š” ๊ณณ
Client State Server State
Client์—์„œ ์†Œ์œ ํ•˜๋ฉฐ ์˜จ์ „ํžˆ ์ œ์–ด ๊ฐ€๋Šฅ Client์—์„œ ์ œ์–ดํ•˜๊ฑฐ๋‚˜ ์†Œ์œ ๋˜์ง€ ์•Š๋Š” ์›๊ฒฉ์˜ ๊ณต๊ฐ„์—์„œ ๊ด€๋ฆฌ๋˜๊ณ  ์œ ์ง€ ๋จ
์ดˆ๊ธฐ๊ฐ’ ์„ค์ •์ด๋‚˜ ์กฐ์ž‘์— ์ œ์•ฝ์‚ฌํ•ญ ์—†์Œ Fetching / Updating์— ํ•„์š”ํ•œ ๋น„๋™๊ธฐ API๊ฐ€ ํ•„์š”ํ•จ
๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค๊ณผ ๊ณต์œ ๋˜์ง€ ์•Š์œผ๋ฉฐ Client ๋‚ด์—์„œ UI/UX ํ๋ฆ„์ด๋‚˜ ์‚ฌ์šฉ์ž ์ธํ„ฐ๋ ‰์…˜์— ๋”ฐ๋ผ ๋ณ€ํ•  ์ˆ˜ ์žˆ์Œ ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค๊ณผ ๊ณต์œ ๋˜๋Š” ๊ฒƒ์œผ๋กœ ์‚ฌ์šฉ์ž๊ฐ€ ๋ชจ๋ฅด๋Š” ์‚ฌ์ด์— ๋ณ€๊ฒฝ๋  ์ˆ˜ ์žˆ์Œ
ํ•ญ์ƒ Client ๋‚ด์—์„œ ์ตœ์‹  ์ƒํƒœ๋กœ ๊ด€๋ฆฌ๋จ ์‹ ๊ฒฝ ์“ฐ์ง€ ์•Š๋Š”๋‹ค๋ฉด ์ž ์žฌ์ ์œผ๋กœ "out of date"๊ฐ€ ๋  ๊ฐ€๋Šฅ์„ฑ์„ ์ง€๋‹˜

React Query ์„ค์น˜

$ npm i @tanstack/react-query
# or
$ yarn add @tanstack/react-query
import {
  useQuery,
  useMutation,
  useQueryClient,
  QueryClient,
  QueryClientProvider,
} from '@tanstack/react-query'

React Query ์ •์˜

  • ์„œ๋ฒ„ ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋กœ ๋ฐ์ดํ„ฐ ๊ฐ€์ ธ์˜ค๊ธฐ, ์บ์‹œ, ๋™๊ธฐํ™”, ๋ฐ์ดํ„ฐ ์—…๋ฐ์ดํŠธ ๋“ฑ์˜ ๊ธฐ๋Šฅ์ด ์žˆ๋‹ค.
  • ๊ธฐ์กด์˜ client state๋ฅผ ๋‹ค๋ฃจ๋Š” ์ƒํƒœ๊ด€๋ฆฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค๊ณผ ๋‹ค๋ฅด๊ฒŒ sever state๋ฅผ Fetching, Caching, ๋น„๋™๊ธฐ์ ์œผ๋กœ ์—…๋ฐ์ดํŠธ ํ•˜๋Š”๋ฐ ๋„์›€์„ ์ฃผ๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋‹ค.
  • ๊ณต์‹ ๋ฌธ์„œ ์˜ˆ์ œ โ–ฝ 
    • React์—์„œ ์“ฐ๋ ค๋ฉด QueryClientProvider ํ•„์ˆ˜!
import {
    QueryClient,
    QueryClientProvider,
    useQuery,
} from "@tanstack/react-query";

const queryClient = new QueryClient();

export default function App() {
    return (
        <QueryClientProvider client={queryClient}>
            <Example />
        </QueryClientProvider>
    );
}

function Example() {
    const { isLoading, error, data } = useQuery({
        queryKey: ["repoData"],
        queryFn: () =>
            fetch(
                "https://api.github.com/repos/tannerlinsley/react-query"
            ).then((res) => res.json()),
    });

    if (isLoding) return "Loading...";

    if (error) return "An error has occurred: " + error.message;

    return (
        <div>
            <h1>{data.name}</h1>
            <p>{data.discription}</p>
            <strong>๐Ÿ‘€ {data.subscribers_count} </strong>
            <strong>โœจ {data.stargazers_count}</strong>{" "}
            <strong>๐Ÿด {data.forks_count}</strong>
        </div>
    );
}

โœ” 3 core concepts of React Query :

1๏ธโƒฃ Queries

  • Queries๋Š” ๋ฐ์ดํ„ฐ fetching์šฉ (GET ๋ฉ”์„œ๋“œ)
  • useQuery
    • ์„œ๋ฒ„๋กœ๋ถ€ํ„ฐ ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•  ๋•Œ ์‚ฌ์šฉํ•œ๋‹ค.
    • ์ฒซ๋ฒˆ์งธ ์ธ์ž๊ฐ’์ธ queryKey๋ฅผ ์ด์šฉํ•˜์—ฌ ์บ์‹ฑ๋œ ๊ฐ’์„ ์ด์šฉํ•˜๊ฑฐ๋‚˜ API๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜จ๋‹ค.
  • Query Key && Query Function ํ•„์š” (key & value ๋งคํ•‘ ๊ตฌ์กฐ)
  • Query Key๋Š” string type/array type ๋‘ ๊ฐ€์ง€๋กœ ๊ด€๋ฆฌ ๊ฐ€๋Šฅ
  • Query Function์€ Promise๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” ํ•จ์ˆ˜
  • useQuery()์˜ ๋ฐ˜ํ™˜ ๊ฐ’

โ˜‘ data : ๋งˆ์ง€๋ง‰์œผ๋กœ ์„ฑ๊ณตํ•œ resolved๋œ ๋ฐ์ดํ„ฐ (Response)
โ˜‘ error : ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์„ ๋•Œ ๋ฐ˜ํ™˜ ๋˜๋Š” ๊ฐ์ฒด
โ˜‘ isFetching : Request๊ฐ€ in-flight ์ค‘์ผ ๋•Œ true
โ˜‘ status, isLoading, isSuccess, isLoading ๋“ฑ๋“ฑ  --> ํ˜„์žฌ query์˜ ์ƒํƒœ
โ˜‘ refetch : ํ•ด๋‹น query refetch ํ•˜๋Š” ํ•จ์ˆ˜ ์ œ๊ณต
โ˜‘ remove : ํ•ด๋‹น query cache์—์„œ ์ง€์šฐ๋Š” ํ•จ์ˆ˜ ์ œ๊ณต 
  • 3๋ฒˆ์งธ ์ธ์ž๋กœ option ๋„ฃ๊ธฐ ๊ฐ€๋Šฅ

โ˜‘ onSuccess, onError, onSettled : query fetching ์„ฑ๊ณต/ ์‹คํŒจ/ ์™„๋ฃŒ ์‹œ ์‹คํ–‰ํ•  Side Effect ์ •์˜
โ˜‘ enabled : ์ž๋™์œผ๋กœ query๋ฅผ ์‹คํ–‰์‹œํ‚ฌ์ง€ ๋ง์ง€ ์—ฌ๋ถ€
โ˜‘ retry : query ๋™์ž‘ ์‹คํŒจ ์‹œ, ์ž๋™์œผ๋กœ retry ํ• ์ง€ ๊ฒฐ์ •ํ•˜๋Š” ์˜ต์…˜
โ˜‘ select : ์„ฑ๊ณต ์‹œ ๊ฐ€์ ธ์˜จ data๋ฅผ ๊ฐ€๊ณตํ•ด์„œ ์ „๋‹ฌ
โ˜‘ keepPreviousData : ์ƒˆ๋กœ๊ฒŒ fectching ์‹œ ์ด์ „ ๋ฐ์ดํ„ฐ ์œ ์ง€ ์—ฌ๋ถ€
โ˜‘ refetchInterval : ์ฃผ๊ธฐ์ ์œผ๋กœ refetch ํ• ์ง€ ๊ฒฐ์ •ํ•˜๋Š” ์˜ต์…˜

2๏ธโƒฃ Mutations

  • get ์š”์ฒญ์ด์™ธ์— ์„œ๋ฒ„ ์ƒํƒœ๋ฅผ update ํ•  ๋•Œ ์‚ฌ์šฉ( POST, DELETE, PATCH)
  • useMutation()์˜ ๊ฒฝ์šฐ Query key ์—†์ด ํ”„๋กœ๋ฏธ์Šค ๋ฐ˜ํ™˜ ํ•จ์ˆ˜๋งŒ ์ธ์ž๋กœ ์ „๋‹ฌํ•ด ์ฃผ๋ฉด ๋จ
  • ๋‹จ, Query key ๋„ฃ์–ด์ฃผ๋ฉด dev tools์—์„œ ๋ณผ ์ˆ˜ ์žˆ์Œ
  • ๋ฐ˜ํ™˜ ๊ฐ’

โ˜‘ mutate : mutation์„ ์‹คํ–‰ํ•˜๋Š” ํ•จ์ˆ˜
โ˜‘ mutateAsync : mutate์™€ ๋น„์Šทํ•˜๋‚˜ Promise๋ฅผ ๋ฐ˜ํ™˜ํ•จ
โ˜‘ reset : mutation ๋‚ด๋ถ€ ์ƒํƒœ clean
โ˜‘ ๋‚˜๋จธ์ง€๋Š” useQuery์™€ ์œ ์‚ฌ ํ•ฉ๋‹ˆ๋‹ค.
  • ์˜ต์…˜ ๊ฐ’

โ˜‘ onMutate : ๋ณธ๊ฒฉ์ ์ธ Mutation ๋™์ž‘ ์ „์— ๋จผ์ € ๋™์ž‘ํ•˜๋Š” ํ•จ์ˆ˜, Optimistic update ์ ์šฉํ•  ๋•Œ ์œ ์šฉ
โ˜‘ ๋‚˜๋จธ์ง€๋Š” useQuery์™€ ์œ ์‚ฌ
Optimistic update ๋ž€?
๋‚™๊ด€์  ์—…๋ฐ์ดํŠธ
์ฆ‰, API ์š”์ฒญ์ด ์„ฑ๊ณตํ•  ๊ฒƒ์ด๋ผ ๋ณด๊ณ  UI๋ฅผ ๋จผ์ € ์—…๋ฐ์ดํŠธ, ์„ฑ๊ณต ์‹œ ๊ทธ๋Œ€๋กœ ๊ฐ€๊ณ  ์‹คํŒจ ์‹œ ๋กค๋ฐฑ

3๏ธโƒฃ Query Invalidation

  • ๊ฐ„๋‹จํžˆ queryClient๋ฅผ ํ†ตํ•ด invalidate ๋ฉ”์†Œ๋“œ๋ฅผ ํ˜ธ์ถœํ•˜๋ฉด ๋
// Invalidate every query in the cache
queryClient.invalidateQueryies()

// Invalidate every query with a key that starts with 'todos'
queryClient.invalidateQueryies('todos')
  • ํ•ด๋‹น key๋ฅผ ๊ฐ€์ง„ query๋Š” stale ์ทจ๊ธ‰ ๋˜๊ณ , ํ˜„์žฌ rendering ๋˜๊ณ  ์žˆ๋Š” qeury๋“ค์€ ๋ฐฑ๊ทธ๋ผ์šด๋“œ์—์„œ refetch ๋ฉ๋‹ˆ๋‹ค.

Caching & Synchronization

Query ์˜ต์…˜์œผ๋กœ cacheTime, staleTime, refetchOnWindowFocus, refetchOnMount ๋“ฑ์ด ์žˆ๋‹ค

React-query์—์„œ Cache
โ˜‘ cacheTime : ๋ฉ”๋ชจ๋ฆฌ์— ์–ผ๋งˆ๋งŒํผ ์žˆ์„ ๊ฑด์ง€(ํ•ด๋‹น ์‹œ๊ฐ„ ์ดํ›„ GC์— ์˜ํ•ด ์ฒ˜๋ฆฌ, default 5๋ถ„)
โ˜‘ staleTime : ์–ผ๋งˆ์˜ ์‹œ๊ฐ„์ด ํ๋ฅธ ํ›„์— ๋ฐ์ดํ„ฐ๋ฅผ stale ์ทจ๊ธ‰ ํ•  ๊ฒƒ์ธ์ง€(default 0)
โ˜‘ refetchOnMount / refetchOnWindowFocus / refetchOnReconnect : true ์ด๋ฉด Mount / window focus / reconnect ์‹œ์ ์— data๊ฐ€ stale์ด๋ผ๊ณ  ํŒ๋‹จ๋˜๋ฉด ๋ชจ๋‘ refetch (๋ชจ๋‘ default true)

๋ฆฌ์•กํŠธ ์ฟผ๋ฆฌ ์ƒํƒœ ํ๋ฆ„

  • staleTime์˜ default ๊ฐ’์ด 0์ด๋ฏ€๋กœ customํ•˜์ง€ ์•Š๋Š”๋‹ค๋ฉด fetching ๋  ๋•Œ ๋ฐ”๋กœ stale์ƒํƒœ๋กœ ๋„˜์–ด๊ฐ
  • staleTime์„ customํ•ด์„œ 0๋ณด๋‹ค ํฌ๊ฒŒ ๋งŒ๋“ค์–ด ์ฃผ๋ฉด fresh ์ƒํƒœ๋ฅผ ์œ ์ง€
  • stale ์ƒํƒœ๋Š” ์Šคํฌ๋ฆฐ์—์„œ ์‚ฌ์šฉ๋˜๋Š” ๋™์•ˆ active ์ƒํƒœ๋กœ ์œ ์ง€ ๋จ
  • ์Šคํฌ๋ฆฐ์—์„œ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค๋ฉด inactive ์ƒํƒœ๋กœ ๋ฐ”๋€Œ๊ณ  ,cacheTime์ด ๋งŒ๋ฃŒ๋˜๊ธฐ ์ „๊นŒ์ง€ ๋ฉ”๋ชจ๋ฆฌ์—์„œ ์œ ์ง€๋จ
  • cacheTime์ด ๋งŒ๋ฃŒ๋˜๋ฉด GC์— ์˜ํ•ด ์ฒ˜๋ฆฌ๋จ
  • ์ฆ‰, ์ƒํƒœ๊ฐ€ fresh ํ•˜๋‹ค๋ฉด refetch๊ฐ€ ์ผ์–ด๋‚˜์ง€ ์•Š์Œ!
์ •๋ฆฌ

โ˜‘ fresh : ์ƒˆ๋กญ๊ฒŒ ์ถ”๊ฐ€๋œ ์ฟผ๋ฆฌ & ๋งŒ๋ฃŒ๋˜์ง€ ์•Š์€ ์ฟผ๋ฆฌ โžœ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๋งˆ์šดํŠธ, ์—…๋ฐ์ดํŠธ๋˜์–ด๋„ ๋ฐ์ดํ„ฐ ์žฌ์š”์ฒญ โŒ
โ˜‘ fetching : ์š”์ฒญ ์ค‘์ธ ์ฟผ๋ฆฌ
โ˜‘ stale : ๋งŒ๋ฃŒ๋œ ์ฟผ๋ฆฌ โžœ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๋งˆ์šดํŠธ, ์—…๋ฐ์ดํŠธ๋˜๋ฉด ๋ฐ์ดํ„ฐ ์žฌ์š”์ฒญ โญ•๏ธ
โ˜‘ inactive : ๋น„ํ™œ์„ฑํ™”๋œ ์ฟผ๋ฆฌ โžœ ํŠน์ • ์‹œ๊ฐ„์ด ์ง€๋‚˜๋ฉด ๊ฐ€๋น„์ง€ ์ปฌ๋ ‰ํ„ฐ์— ์˜ํ•ด ์ œ๊ฑฐ

zero-config (๊ธฐ๋ณธ ์„ค์ • default ๊ฐ’)
  • Queries์—์„œ cached data๋Š” ์–ธ์ œ๋‚˜ stale ์ทจ๊ธ‰
  • ๊ฐ ์‹œ์ ์—์„œ data๊ฐ€ stale์ด๋ผ๋ฉด ํ•ญ์ƒ refetch ๋ฐœ์ƒ
  • inactive Query๋“ค์€ 5๋ถ„ ๋’ค GC์— ์˜ํ•ด ์ฒ˜๋ฆฌ
  • Query ์‹คํŒจ ์‹œ 3๋ฒˆ๊นŒ์ง€ retry ๋ฐœ์ƒ

React-query์—์„œ ๋ฐ์ดํ„ฐ ๊ด€๋ฆฌ

  • ๋งˆ์น˜ ์ „์—ญ์ƒํƒœ์ฒ˜๋Ÿผ ๊ด€๋ฆฌ๋˜๋Š” ๋ฐ์ดํ„ฐ → ContextAPI ์‚ฌ์šฉ
    • QueryClient ๋‚ด๋ถ€์ ์œผ๋กœ Context ์‚ฌ์šฉ

์ฐธ์กฐ 

https://hoime.tistory.com/92?category=534509 

 

[React ์ƒํƒœ๊ด€๋ฆฌ] react-query ์ž…๋ฌธ ํ•˜๊ธฐ

https://www.youtube.com/watch?v=MArE6Hy371c&t=2195s react-query๋ฅผ ๊ณต๋ถ€ํ•˜๊ธฐ ์œ„ํ•ด ํ•ด๋‹น ์˜์ƒ์„ ๋ณด๊ณ  ์ •๋ฆฌ, ์š”์•ฝํ•œ ๊ฒŒ์‹œ๊ธ€ ์ž…๋‹ˆ๋‹ค. โœ๏ธ FE ์ƒํƒœ๊ด€๋ฆฌ์— ๋Œ€ํ•ด redux, mobx, recoil ๊ฐ™์€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ๋– ์˜ฌ๋ฆด ์ˆ˜ ์žˆ์Œ ์ƒํƒœ

hoime.tistory.com

https://manon-kim.tistory.com/entry/React-Query

 

[React] React Query๋กœ ์„œ๋ฒ„ ์ƒํƒœ ๊ด€๋ฆฌ

React Query Client State : ์›น ๋ธŒ๋ผ์šฐ์ € ์„ธ์…˜๊ณผ ๊ด€๋ จ๋œ ๋ชจ๋“  ์ •๋ณด ex) ์œ ์ €๊ฐ€ ์–ธ์–ด๋‚˜ ํ…Œ๋งˆ๋ฅผ ๋ณ€๊ฒฝํ•˜๋Š” ๋“ฑ์˜ ์ผ (์„œ๋ฒ„์™€ ๊ด€๋ จ x) Server State : ํด๋ผ์ด์–ธํŠธ์— ํ‘œ์‹œํ•˜๋Š” ๋ฐ ํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ React Query server data cach

manon-kim.tistory.com

 

Comments