2,576 questions
1
vote
2
answers
144
views
How to display msg received in API response on page?
I have one function which checks for user authorization
export const authUser = (rideId, action) => {
return (dispatch, getState) => {
const postData = {
consumer: "Rapi",
...
1
vote
1
answer
148
views
Await a dispatch thunk before executing some code is working but compiler complains
So I was tasked to fix some buttons so that there is a loading spinner present when they are clicked. The problem is that my solution is not ideal since intellij complained that I have unessesarry ...
0
votes
0
answers
35
views
useEffect and dispatch with asyncThunk not working. What am i doing wrong? [duplicate]
In my code below i am using useEffect with dispatch and inside the dispatch function I am using an asyncThunk. If i console.log, in the fulfilled function provided by the thunk, the user then i get ...
1
vote
1
answer
138
views
Redux thunk - Uncaught TypeError: middleware is not a function
I am a complete beginner, I'm following a tutorial on redux thunk and keep getting this error:
redux.js:642 Uncaught TypeError: middleware is not a function
at redux.js:642:1
at Array.map (<...
-1
votes
1
answer
93
views
unexpected behaviour of dispatching action in redux
I have the following async thunk function:
const loadProject = createAsyncThunk(
'[Project API] Load Project',
async (project: IKProject, { dispatch }) => {
await kProjectService....
0
votes
1
answer
50
views
Using Redux Persist [duplicate]
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 ...
0
votes
0
answers
26
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 ...
0
votes
0
answers
18
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, ...
1
vote
1
answer
117
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.
...
1
vote
1
answer
892
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 ...
1
vote
2
answers
1k
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-...
0
votes
1
answer
274
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()) // `...
1
vote
1
answer
433
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 ...
-1
votes
1
answer
171
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 { ...
1
vote
1
answer
103
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 ...