All Questions
219 questions
0
votes
1
answer
65
views
RTKQuery with SignalR Websocket
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....
-1
votes
1
answer
93
views
Why am I getting 'X is not a function or its return value is not iterable' in JavaScript?
I am trying to iterate over the result of calling function X, but I get the error: 'X is not a function or its return value is not iterable.
I am using RTK Query. I am fetching data using post call on ...
1
vote
1
answer
273
views
redux toolkit + RTK query dynamic slice Injection using combineSlices
We are creating an application on the React + Redux Toolkit + RTK Query + Webpack Module Federation + Nx stack. The idea is to split a large application into modules, create a global store and fill it ...
0
votes
1
answer
1k
views
How to trigger data fetching from an action with RTK Query?
I'm not new to Redux, but I am new to RTK and RTK Query. Back in the old days the way you'd trigger data to refetch whenever a specific action happened (I changed my form state, that means I want to ...
0
votes
1
answer
154
views
Get data straight from query hook regardless of params sent
I have a table where all of the fetched data renders and I have different components that make api calls with different args (filters). How can I use query hooks to get any fetched data to render in ...
2
votes
1
answer
75
views
Redux-Toolkit-Query: polling, selectfromReult with selectors
I am using below Redux-Toolkit Query (RTKQ) hooks to get information from one of the API and polling this for every 5 seconds, and selectFromResult to get the desired data.
const selectorData = ...
1
vote
1
answer
324
views
Confusion with Additional Properties Stored in Redux State When Using RTK Query
I've been using Redux Toolkit for a while with async thunks making calls using Axios. I find it super convenient that calling the thunk in dispatch directly saves my response in the store, allowing me ...
1
vote
1
answer
302
views
useLazyQuery doesn't update data between all components
I'm currently using the useXXXLazyQuery hook of rtk query for handling the login of my page, the problem is that i don't have the latest data in my ProtectedRoute component.
The code is as following:
...
2
votes
1
answer
207
views
RTK Query caching between endpoints
I'm having trouble understanding the caching behavior with RTK query.
import React, { useState } from 'react';
import { createRoot } from 'react-dom/client';
import { Provider } from 'react-redux';
...
1
vote
1
answer
268
views
How to trigger() RTK useLazyQuery in a loop that renders components?
Using: RTK and RTKQ
Problem: I am trying to trigger()/fetch a query inside a loop that renders a component list however, it is giving me errors like 'Too many re-renders' or 'data' does not exist.
...
1
vote
1
answer
279
views
How to use the same RTK query function multiple times with different params in the same component?
I am trying to use RTK query with different params in this situation:
I have shopping cart with mutliple items, each item has counter to control the quantity of the purchased item so i can add or ...
1
vote
1
answer
69
views
RTK Query, Api hook , _store_slices_apiScenarioSlice_js__WEBPACK_IMPORTED_MODULE_1__.myhookname) is not a function
I am trying to use Redux-Toolkit (RTK) Query and I am getting below error:
(0 ,
store_slices_apiScenarioSlice_js__WEBPACK_IMPORTED_MODULE_1_.useGetScenarioData)
is not a function TypeError: (0 ,
...
1
vote
1
answer
401
views
RTK Query cannot set tag id
I am trying to setup RTK Query and have some troubles with defining a tag-id.
No matter what I try, I cannot seem to make the "Timeseries" tag work with an id.
Here is my api:
export type ...
-1
votes
1
answer
376
views
The callback of RTK updateQueryData is not getting triggered
I have the following RTK Query and the mutation. On success, I need to amend the response of the mutation to the response of the Query. I use updateQueryData() for this, but the update doesn't work. I ...
2
votes
0
answers
177
views
Redirect user in Redux middleware while using Next js
I have a Next js project that is using RTK query to handle my API requests and I have implemented middleware that handles errors from API, named "errorMiddleware"
here is the part of ...