Skip to main content

Questions tagged [redux-toolkit]

Redux Toolkit (RTK) is the standard approach for writing Redux logic. It provides utilities to simplify several common Redux use cases, including store setup, defining reducers, immutable update logic, and even creating entire "slices" of state at once.

0 votes
1 answer
13 views

Using Redux Persist

I was using Redux Toolkit and tried to use Redux Persist but on terminal it shows this. A non-serializable value was detected in an action, in the path: `register`. Value: [Function: register] Take a ...
kodeater's user avatar
1 vote
1 answer
29 views

update multiple objects in array using redux toolkit

I have a store called stories which has a userStories object stored. Example of userStories object inside store: userStories: { userId1: [{storyId: 1, viewedBy: [id5, id2, id9]}, {...
Max adam's user avatar
  • 105
0 votes
0 answers
20 views

Redux State Does Not Change When Modified From useInterval

so im trying to load user data from localStorage and set it to the redux user state. heres what i have done: Where The User Is Being Used: import Fruit from "../components/Fruit" import { ...
AmirparsaDD's user avatar
0 votes
1 answer
35 views

Redux Question: When <App/> Component re-renders, does it cause all selectors to run again

I have read in Redux docs: The selector will be run whenever the function component renders (unless its reference hasn't changed since a previous render of the component so that a cached result can ...
moath's user avatar
  • 11
0 votes
0 answers
9 views

How to use cached data in a different component using useLazyQuery in RTK Query?

I am using useLazyQuery and a trigger function to trigger an API call from a component(let's say A) but in another component(let's say B) I just want to subscribe to the cached data, I don't want to ...
Derek emmanuel's user avatar
0 votes
1 answer
24 views

how can I immediately updating data with redux when I fetch API ؟ [closed]

when I update data using API the state in redux not updating immediately but should I reload the page to view the values updating ??? I get already the data but if I want the new values of data must ...
Hazem-Alsaqaan's user avatar
-1 votes
0 answers
27 views

Why do all posts have one identical copy with identical data [closed]

I've recently been making blog pet project and encountered problem of posts having identical copies. Because of that when I try to add reactions to the post I keep getting next error It starts from 1 ...
zhans's user avatar
  • 1
0 votes
1 answer
20 views

RTK Query: Middleware - Property 'error' does not exist on type '{}'

I am trying to create a errorMiddleware that will toast message whenever there is an error occuring from the api calls. The action arguement is throwing a TS type error that says: Property 'error' ...
Sushant's user avatar
  • 59
0 votes
0 answers
19 views

Syntactic problems with Redux middleware when try to add .concat(authMiddleware)

Here is authMiddleware: "use client"; import { Middleware } from "@reduxjs/toolkit"; import { clearUserProfile } from "../reducers/userProfile"; import { clearIdToken } ...
Cường Trần Văn's user avatar
-1 votes
0 answers
17 views

Cannot setup Redux debugging with `remote-redux-devtools`

So I've been trying to incorporate remote-redux-devtools in my middleware for debugging of Redux in React Native. Previously I used Flipper but since it's being deprecated I need to find another ...
Nikk's user avatar
  • 7,779
-1 votes
1 answer
42 views

Resolving the issue : Cast to ObjectId failed for value "[object Object]" (type string) at path "_id" for model "products"

Error message: Cast to ObjectId failed for value "[object Object]" (type string) at path "_id" for model "products". I'm attempting to retrieve a product, but I keep ...
Conrad's user avatar
  • 51
-1 votes
1 answer
24 views

How to clear the cache of a query in RTKQuery

I'm currently in a situation where I'm questioning the best way to handle this situation with RTKQuery: I have a table that displays a set of data. In this table, you have the possibility to select a ...
Fabrizio Paolo Petrelli's user avatar
1 vote
1 answer
26 views

Redux-toolkit: Error: An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft. + void

I have 2 apps, notes app and anecdotes app. Both are React 18 apps. And I am using the Redux-toolkit. Both apps are fairly similar. One difference is that the notes app has a reducer to toggle the ...
qqq's user avatar
  • 846
1 vote
0 answers
29 views

how to use localStorage in redux-toolkit with nextJS?

So i have a problem with localStorage and nextJS, and I need SSR to work. Here is the code: import { createSlice } from "@reduxjs/toolkit" const initialState = { theme: typeof ...
Max Doer's user avatar
-3 votes
1 answer
58 views

TypeError: 0, _$$_REQUIRE(_dependencyMap[15], "redux").isAction is not a function (it is undefined)

Everything works when you remove the persisted reducer, and does not work with the persisted reducer. This is likely due to an issue with redux-persist, which is an older but still extremely popular ...
Steven Matthews's user avatar

15 30 50 per page
1
2 3 4 5
244