Skip to main content

All Questions

Tagged with
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....
user101289's user avatar
  • 10.5k
-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 ...
noBoom's user avatar
  • 145
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 ...
kyrisss's user avatar
  • 13
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 ...
EibhlìnNicColla's user avatar
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 ...
magrega's user avatar
  • 318
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 = ...
CodingEzio's user avatar
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 ...
Brijraj's user avatar
  • 63
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: ...
Fabrizio Paolo Petrelli's user avatar
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'; ...
Martin McCann's user avatar
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. ...
Miguel's user avatar
  • 31
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 ...
HUS.97's user avatar
  • 17
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 , ...
Bhasker Kumar's user avatar
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 ...
torgeir tislevoll's user avatar
-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 ...
David Johns's user avatar
  • 1,764
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 ...
Vala Khosravi's user avatar

15 30 50 per page
1
2 3 4 5
15