Category "redux-toolkit"

Redux toolkit: Uncaught TypeError: Cannot read properties of undefined (reading 'type')

I get the following error when I add a specific action in the extraReducers inside a slice: Uncaught TypeError: Cannot read properties of undefined (reading 'ty

How to fix circular dependencies of slices with the RootState?

I recently started using redux-toolkit and started writing my reducers using the createSlice following their docs. One reducer, let's call it reducerA, imports

Redux RTK not auto-generating react hooks

Could not find any info on this that explains why its not generating and how to force it to re-generate these hooks. First I thought I had to run the app to get

Upload Image with Axios Post request

I am trying to make a post request to an api to upload a user image and send it to the api for profile settings.But i always receive "the image field is require

Entity adapter getSelectors method generates "Cannot read property 'map' of undefined" error

I am trying to use createEntityAdapter from reduxjs/toolkit to generate selectors automatically. I have created a "select all" selector successfully using creat

How to use redux toolkit's preloadedState and createSlice together properly?

I am trying to migrate to redux toolkit, but just encountered an issue. Here's an example of simple counter slice. import { createSlice } from "@reduxjs/toolkit

How to type properties in merging object for getInitialState of createEntityAdapter object?

I want to type status with FetchingStatus type. How to implement that? type FetchingStatus = 'idle' | 'loading' | 'succeeded' | 'failed'; const initialState =

React I have an endless loop rendering my edit component

I have two components. My dashbord-component, in which I am dispatching the getAllDropDownRessort, which triggers the findAll function in my dropdownRessortSlic

Exported variable 'store' has or is using name '$CombinedState' from external module error Redux toolkit and redux persist

Hi I'm trying to get redux persist working with redux toolkit (also in typescript) I'm getting the following error: Exported variable 'store' has or is using na

Reset state to initial with redux-toolkit

I need to reset current state to initial state. But all my attempts were unsuccessful. How can I do it using redux-toolkit? const showOnReviewSlice = createSlic

Argument of type 'AsyncThunkAction<any, void, {}>' is not assignable to parameter of type 'AnyAction'

store.ts export const store = configureStore({ reducer: { auth: authReducer }, middleware: [], }); export type AppDispatch = typeof store.d

does redux change the reference of rootState object when a field's value in a sub state changes?

i have my redux states setup like this rootState subState1 field1 field2 subState2 field1 field2 multiple sub

RTK Query: Specifying error type per endpoint

Is there a way to specify error response per endpoint? Like we can specify Result & Request type when defining a query or mutation. I did went through the d

How to apply createEntityAdapter to createApi slice

I have implemented successfully a redux-toolkit api. Now Im trying to use createEntityAdapter to be able to use the pre-built selector methods. import { creat

Removing a value from an array using redux toolkit

I am new to using "@reduxjs/toolkit" (version "^1.5.1"). I am trying to remove an object from within the state's array (roundScore). This is usually something t

Redux Toolkit Query real time updates

is it possible get real time updates maybe I have a product and the amount of product goes from 2 to 1, can I show this in real time with rtk query ?

How to get updated state from Redux store using redux-toolkit after component has already rendered?

The functionality I am looking for is that of an e-commerce website. A click on the add-to-cart button adds product to cart. I am able to successfully achieve t

RTK query with Storybookjs

I am using RTK query with typescript in my react application and its working fine however storybookjs is not able to mock data for RTK query. I am trying to moc

Redux Toolkit: can I use createAsycThunk with Firebase listener functions (e.g. firestore.collection.onSnapshot)

Is there a way to use createAsyncThunk with Firebase listeners, for example firestore.collection.onSnapshot? It may not work because the way onSnapshot works (i

redux-persist is not saving my redux state when I refresh or close my react-native app

My react-native app is not saving my data using redux toolkit, redux-persist and asyncstorage import AsyncStorage from '@react-native-async-storage/async-storag