3 ms·
I started my current project using SWR and then switched to react-query after dealing with some annoyances with SWR. Overall react-query is impressive for data
by dinkleberg 6y ago
I started my current project using SWR and then switched to react-query after dealing with some annoyances with SWR.
Overall react-query is impressive for data fetching, but I’ve run into issues with mutations and cache invalidation.
- AgentME 6y agoI've been disappointed at how SWR and react-query seem to only support the bare minimum for mutations. As far as I can tell, they don't offer any kind of protection from refreshes overwriting any local mutations that haven't been saved to the server yet. They don't do any handling around updating the data on the server, so you need to handle issues yourself like retrying, deciding when to send to the server, and making sure you never have overlapping update requests racing each other. I've had trouble finding any library in the React or general JS ecosystem that handles this stuff.
- shuding 6y agoHey! SWR author here. Mind sharing the annoyances and how I can make it better for you?
- andrewrothman 6y agoThanks for your contribution and outreach! SWR has been really helpful for us at work.