요약

react-query 너, 다음에 보자..

본래 스터디 주제는 react-qurey 였다.
공부하다 보니 공식문서도 아직은 별로이고, 자료도 생각보다 많지 않았음.

한국어 친화(?) 적인 SWR 공식문서이 일단 너무 맘에 들고, SWR이 정리된 글이 많아 react-query와 동일하게 Server-State 관리 라이브러리인 SWR을 학습하기로 결정!

SWR

React-hooks library for Data fetching The name “SWR” is derived from stale-while-revalidate

GitHub - vercel/swr: React Hooks for data fetching

stale-while-revalidate ?

Cache-Control: max-age=1, stale-while-revalidate=59 (출처 : https://jooonho.com/web/2021-05-16-stale-while-revalidate/)

Untitled

사용 방법

<aside> 💡 const { data, error, isValidating, mutate } = useSWR(key, fetcher, options)

</aside>

Parameter

/api/user