2 Replies
xenogeneic-maroon•2y ago
Not really an RTK Query user here 🙌🏼, but is there not a way to Dispatch RTK Query actions/thunks independently to React?
Like how would you trigger query-b after query-a is complete (in Redux land)?
Because you can't call hooks inside of a loader since that environment isn't a React component, just from Javascript that's running before your Component is rendered.
like-gold•15mo ago
See https://redux-toolkit.js.org/rtk-query/api/created-api/endpoints#initiate and https://redux-toolkit.js.org/rtk-query/usage/usage-without-react-hooks
Usage Without React Hooks | Redux Toolkit
RTK Query > Usage > Usage Without React Hooks: Using RTKQ with other UI frameworks
