Questions tagged [react-thunk]

48 questions
1
vote
2 answers

Error is as follows: TypeError: projects.map is not a function

[enter image description here][1] I was trying to connect my react frontend to my spring boot backend. I encountered this error. how to resolve this? *I am a react and javascript newbie and trying to build a new application. I tried the solution on…
Jai Behl
  • 31
  • 3
1
vote
1 answer

React js: TypeError: Object(...) is not a function

I tried to figure out what the error is, but I couldn't overcome it. Below are the error and the code. import React from 'react'; import ReactDOM from 'react-dom'; import { App } from './App'; import './index.css'; import * as serviceWorker from…
1
vote
1 answer

In redux-thunk with typescript, calling getState returns never

Code: type MyType = ThunkAction export const play = (): MyType => (dispatch, getState) => { const music = getState().music if(music.list.length !== 0) dispatch(play()) } In my…
1
vote
0 answers

Redux property increment not working, if call through child component

I have flatlist having images, videos. for images, I defined duration to show and then move to the next item in flatlist, but in case of the video once a video ended then move to next item. I am using Redux for currentlyPlayingIndex and flatlist…
Sheshnath
  • 3,293
  • 1
  • 32
  • 60
1
vote
1 answer

React Redux Thunk Pass This.Props Methods in Action Creator

I am using react with react-stepzilla with Redux , Redux-thunk the problem is i want to use jumpToState(n) method inside action creator. but i am not able to access this method inside redux action creator file. Action File export const checkUser =…
Vikram
  • 41
  • 1
  • 1
  • 4
1
vote
1 answer

getState().property return undefined inside an async function

I'm using react-thunk with redux to implement a login function, but when I access the state using getState(), the property returns undefined. SystemState will set IsLogined and user when LoginSuccessed, I will use it later on for access token. But…
Ray Tang
  • 75
  • 1
  • 10
1
vote
1 answer

React component doesn't update after updating state with redux action

/keywordsActions import { UPDATE_KEYWORDS } from "./actionTypes"; import queryString from "query-string"; const keywordsArrayFromUrl = () => { const query = queryString.parse(window.location.search); if (query.keywords) { const…
1
vote
0 answers

Creating Components based on multiple axios requests

I'm working on redux-thunk project which i need to reach out endpoint-1 to get which & how many components i need to show in a page. Then i'm required to use this return to reach out endpoint-2 and get the data with the parameters from the…
behcet ilhan
  • 21
  • 1
  • 4
1
vote
1 answer

Component not being updated after state is changed in reducer

I would like to display the error to my user. An error is thrown and the error and message are updated in the reducer by the action. But for some reason I can't get the error or message to display for the user. Is there something wrong with the…
Roro
  • 427
  • 2
  • 8
  • 20
1
vote
3 answers

react/api - how to parse and map an array inside of api response

I'm trying to parse and map through the array "items" inside of this api response [ { "id": "", "portal_account_id": "", "platform": "", "current_date": "2018-07-30T11:27:16+02:00", "email": "", "items": [ { …
develop05
  • 487
  • 1
  • 9
  • 23
0
votes
0 answers

"Module not found: Error: Can't resolve 'redux-thunk/extend-redux'"

This all started when I was trying to fix the "ThunkAction is not assignable to parameter of type 'AnyAction'." error in one of my actions. I added import 'redux-thunk/extend-redux';, it solved the issue, and then when I actually got to running the…
Meep Meep
  • 11
  • 1
0
votes
0 answers

Undefined is not an object (evaluating 'prevDeps.length') using react-native-skia

I created a donut chart components (DonutChart) that takes an array of values representing percentages. The values are derived from data gathered from a firestore db. When running this: Warning: React has detected a change in the order of Hooks…
0
votes
1 answer

How to redirect on dashboard after successfully login in react js using redux?

I have created login page in react js and api in node js. I am trying to login using email and password using redux. Login Page const Login = () => { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); …
0
votes
1 answer

Problem using redux-thunk to connect an abstract class with Redux state

This is the basic pattern that I use with redux-thunk and class components in React. The below code exports a class definition MyClass which is properly connected with the state brought in by mapStateToProps and has access to the actions defined in…
Marcus Junius Brutus
  • 26,087
  • 41
  • 189
  • 331
0
votes
1 answer

React - How to get data from thunk dispatch in useEffect with useDispatch?

I have a component where I would like to fetch some data. I have this fetch function: export const getServicesFromExternalApi = ( customerNumber: string, subcustomer: string | null, pickupCountryCode: string, pickupPostalCode:…
Ludwig
  • 1,401
  • 13
  • 62
  • 125