DEV Community

Discussion on: useReducer instead of useState while calling APIs!

Collapse
 
stereoplegic profile image
Mike Bybee • Edited

Or React Query. But yes, separate server fetching from local state.

Collapse
 
rexgalilae profile image
RexGalilae

This! No need to reinvent the wheel every time you want an API dependent state variable

Collapse
 
flexbox profile image
David Leuliette 🤖 • Edited

@stereoplegic
Do you know what are the differences between swr and react-query?

I use both and I have no idea how to pitch the differences 😆

Thread Thread
 
stereoplegic profile image
Mike Bybee

Tanner Linsley (author of React Query) details the differences here (also comparing Apollo and RTK Query) much better than I can: react-query.tanstack.com/comparison

Some comments have been hidden by the post's author - find out more