DEV Community

Discussion on: React doesn't need state management tool, I said

Collapse
 
stepan662 profile image
Štěpán Granát

The problem is that I really like using hook libraries like react-query and those are not designed to cooperate with REDUX. I think that's also a reason why many people just want to use context, because you keep whole power of hooks in there and you can just pass data to all children.

Thread Thread
 
buzziebee profile image
Tom Bee

You should check out rtk query. It's part of redux toolkit now and is fantastic. I use the rtk query codegen to automatically create the entire interface with my backend from the swagger. It builds all the redux integration as well as properly typed hooks to use in components.

Thread Thread
 
lexiebkm profile image
Alexander B.K.

Yeah... RTK Query seems to make our task in defining endpoints for data fetching easier or more directly/intuitively. Instead of using createSlice and createAsyncThunk for that purpose, we can just use createApi and fetchBaseQuery.