Silver Library (Archived)
react-query 와 RTK query 에 대한 생각. 본문
요약을 하자면:
"eliminating the need to hand-write data fetching & caching logic yourself." - RTK query
'Powerful asynchronous state management' - react-query
사실 react-query 를 써보기는 했으나, Redux 를 막상 지금 써보니 Redux 도 괜찮다는 생각이 든다.
그리고 노린 듯이...이 RTK query 를 끼워서 제공한다고 한다.
다만 이전에 react-query 로 하면서 CORS policy 에러가 문득문득 되었다 안되었다 하는 현상을 본 적이 있으므로(다만 이버전은 tanstack 이 아닌, 기존 버전이었으니 이해는 간다. 덕분에 그 에러를 피하려면 어찌해야 하는지도 알게 되었으니...) 개인적으로는 RTK query 도 한번 접해보고 싶다는 욕구가 강해지고 있는 요즘이다.
어느 쪽이든, 머리로 이해하고만 있어야 한 상태관리 설계를 직관적이게 볼 수 있도록 도와주고 있으니 말이다.
React-query 주장:
Comparison | React Query vs SWR vs Apollo vs RTK Query vs React Router | TanStack Query Docs
This comparison table strives to be as accurate and as unbiased as possible. If you use any of these libraries and feel the information could be improved, feel free to suggest changes (with notes or evidence of claims) using the "Edit this page on Github"
tanstack.com
Redux (RTK query) 주장:
https://redux-toolkit.js.org/rtk-query/comparison#comparing-feature-sets
Comparison with Other Tools | Redux Toolkit
RTK Query > Comparison: Compares features and tradeoffs vs other similar tools
redux-toolkit.js.org
'Face the fear, build the future' 카테고리의 다른 글
Svelte 란 무엇일까. React를 계속 써도 될까. (0) | 2022.12.28 |
---|---|
6월 16일 - 상황과 전략 (0) | 2022.06.16 |
6월 14일 - 새로운 사이드 프로젝트 구상 (0) | 2022.06.14 |
[Note] Project - side project (0) | 2022.05.28 |
컴퓨터를 만져오면서 지금도 알 수 없는 것. (0) | 2022.05.22 |