Skip to main content

Questions tagged [redux-thunk]

Thunk middleware for Redux. Redux Thunk middleware allows you to write action creators that return a function instead of an action. The thunk can be used to delay the dispatch of an action, or to dispatch only if a certain condition is met. The inner function receives the store methods dispatch and getState() as parameters.

redux-thunk
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
0 votes
0 answers
19 views

Err: The requested module 'redux-thunk' does not provide an export named 'default' [duplicate]

I am currently learning redux and encountered an issue with importing redux-thunk in my Node.js project. I’m trying to set up middleware for my Redux store, but when I attempt to import redux-thunk, I ...
elclasico's user avatar
0 votes
0 answers
13 views

impoerted thunk was not found in redux-thunk [duplicate]

i see this error when i start the project "ERROR in ./src/redux/reducers/configureStore.js 7:57-62 export 'default' (imported as 'thunk') was not found in 'redux-thunk' (possible exports: thunk, ...
user25315893's user avatar
1 vote
1 answer
54 views

Redux toolkit TypeError: Cannot read properties of undefined (reading 'type') while fetching data with redux thunk

I need to fetch data from my API with redux thunk and axios. but I'm facing this error inside my console. In this case I have a marketSlice and I want to update my state.market with API Data. ...
Hero's user avatar
  • 118
1 vote
1 answer
174 views

I am getting an error while trying to import 'thunk' from 'redux-thunk' [duplicate]

I am new to React and Redux, and I am trying to build a webapp (authentication system) using React and Django. I am following a tutorial to do that, with this github directory. When I try to import ...
Farooq Ahmed's user avatar
1 vote
2 answers
363 views

import thunk from `redux-thunk` not working in stackblitz

Now I am trying basic redux logic in Stackblitz platform. import { createStore, applyMiddleware } from 'redux'; import thunk from 'redux-thunk'; import { composeWithDevTools } from 'redux-devtools-...
Gardener1688's user avatar
0 votes
1 answer
37 views

How do you mock the resolved value of an awaited dispatch

Let's say I have a thunk: import fetchSomeData from '/path/to/fetchSomeData' const myAction = () => async dispatch => { ... const data = await dispatch(fetchSomeData()) // `...
noblerare's user avatar
  • 11.3k
1 vote
1 answer
97 views

Redux Toolkit middleware does not work to handle successful asynchronous actions

I've integrated into my Next.js app some of my own middleware into the Redux-Toolkit store using configureStore. Middleware is designed to handle asynchronous actions such as fetchAccounts/fulfilled ...
Alexander Gnetov's user avatar
-1 votes
1 answer
66 views

Server Error Error: middleware is not a function WHEN I use Redux in NEXTJS

When I run program, it appears error "Server Error Error: middleware is not a function". I don't know why it happened. How can I fix this error? This is my code in store.js import { ...
klng's user avatar
  • 3
1 vote
1 answer
69 views

useSelector value is still null inside handleSubmit button in React

My code flow is that a user fills the form and submits it which goes to action calling the API and then it returns the postId and stores it in the reducer. Now my main React component has useSelector ...
kheman garg's user avatar
0 votes
0 answers
111 views

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

iam using react-Redux-Toolkit + createAsyncThunk . I'm asking this question because an error occurred during development. categorySlice.js: import { createSlice, createAsyncThunk } from "@...
eslam wael's user avatar
0 votes
1 answer
34 views

State not updating after dispatching createBlockSession async thunk

Title: Redux Toolkit - State not updating after dispatching createBlockSession async thunk I'm working on a Redux Toolkit project where I have an async thunk createBlockSession that is supposed to ...
A Mehmeto's user avatar
  • 1,881
1 vote
1 answer
217 views

Getting TypeError: middleware is not a function

I am learning Redux, so wrote below logic by following online resources, but it throws this error: /home/sssawant/Sarvesh/notes_fullstack/frontend/React_notes/redux_demo/node_modules/redux/dist/cjs/...
Sarvesh Sawant's user avatar
0 votes
1 answer
240 views

How can I migrate from redux-thunk 2 to 3 when using redux-mock-store 1.5.4?

With version 2.x.x of redux-thunk and redux-mock-store 1.5.4 this code works: import configureMockStore from 'redux-mock-store'; import thunk from 'redux-thunk'; const mockStore = configureMockStore([...
WillyC's user avatar
  • 4,495
0 votes
1 answer
95 views

Error: Actions may not have an undefined "type" property. You may have misspelled an action type string constant

I'm trying to login and signup in react. using react-redux, thunk v3.1.0, but getting error my auth.types.js file include Auth.action.js include auth.reducer.js include store.js has [![enter image ...
Vivek Nemade's user avatar

15 30 50 per page
1
2 3 4 5
173