I'm using RTK Query in a React + Redux app.When I delete an item using a mutation, I use optimistic updates (in onQueryStarted) to update the /list data without refetching.However, if my /list tags (...
I have a REST API that I want to call from multiple React projects, and I was thinking to make a library that exposes the REST API calls, using the Redux Toolkit Query code generation.I would like to ...
Setting state value from RTK QuerySuppose you fetch some data with a RTK Query endpoint like in the website's example:export function Posts() { const { data : post, isFetching, isLoading } = ...
The request is frozen on the pending status, the loading status does not change in the component {status: “pending”, isLoading: true, data: undefined}, I see the response in devTools and in my API, ...
I have problems with understanding how to properly handle a case. Let's say we have a simplified component:const XComponent = ({ aCallback }) => { const [mutation] = useRtkQueryMutationHook() ...
I currently want to add meta data to the RKT Query request header and it's a variable. I want to pass it from the API request.export const api = createApi({ reducerPath: 'api', baseQuery: ...
I'm working on a React app with Redux-Toolkit (RTK) Query. I need to fetch accounts from the server and then render them as well derive some data from them through a chain of selectors. If I fetch ...
I understand that RTK Query signifies a shift in thinking from Redux store / state management, and the general paradigm is that you use the RTK Query endpoint anytime you need data, and rely on it to ...
I've used redux toolkit for a few years and I'm pretty familiar with it. I'm going through and attempting to update old code using the newer RTK Query strategy to replace some of my old slices and ...
I'm attempting to use RTK Query with a signalR websocket service to keep my react app up to date with server data.My RTK API looks like this:export const hubConnection = new signalR....
I'm having a little problem on my SSR calls for RTK query, they provide hooks to use but in the case of server side rendering, how do I fetch data via RTK query?I could not find a solution for it and ...
I am having issues understanding how to get useLazyQuery to get the cached data on a second time the component is mounted.Imagine the following:... const [trigger, { data }] = api.useLazyQuery(); /...
I'm working on a project using Redux Toolkit (RTK) Query to manage multiple API endpoints, where each API slice is constructed dynamically through a function. My goal is to maintain a dynamic approach ...
I need to make a request to a URL like this /common/path/:userId/specific/path/endpoints. /common/path is shared across many endpoints, and I don't want to put all of those queries in the same file. ...