DEV Community

Discussion on: Do you need a State Management Library?

Collapse
 
link2twenty profile image
Andrew Bone

What is it you like about useQuery? I tend to write my own fetch requests, even though that can lead to code repetition.

Collapse
 
hoandt profile image
hoandt

UseQuery caches fetched data. I would create a custom hook to handle the cache. Like useContext, you can get that cache globally.

It’s very handy to me when I apply it to store logged in user details.