--

I actually used SWR for some time before switching to react-query. They are both great libraries for fetching data. At the time when I decided to switch, react-query had better support for mutations (https://react-query.tanstack.com/guides/mutations), infinite queries (https://react-query.tanstack.com/guides/infinite-queries) and great dev tools (https://react-query.tanstack.com/devtools).

That said, depending on your use case you might not need all that, and SWR will be more than enough. but react-query is definitely my choice nowadays.

--

--

No responses yet