Questions tagged [react-thunk]

48 questions
0
votes
1 answer

createBrowserhistory from history npm Url changes but not component React-redux

Having same version for react and react-dom "react": "^18.2.0", "react-dom": "^18.2.0" and history is latest "history": "^5.3.0", import React from "react"; import ReactDOM from "react-dom/client"; import "./index.css"; import App from…
Sam
  • 29
  • 5
0
votes
1 answer

Trying to pass action.payload from one slice to another different slice

What I am trying to achieve is sending action payload from one slice to another and I have been stuck several hours trying to do so. I have tried accessing the global store but the problem is I am getting errors on doing so I am using redux-tool-kit…
0
votes
1 answer

Redux thunk function not being executed

I recently started looking at redux thunks. It is my understanding it should be used for dealing with async actions or where there's a need to dispatch actions from within other actions. So I've got my store configured such as: import…
MrCujo
  • 1,218
  • 3
  • 31
  • 56
0
votes
1 answer

Error: Cannot read properties of undefined (reading 'get')

I have this error on HomeScreen of my project I want to perform actions on the state of my HomeScreen Page using redux. The data is provided from the api (array of items) then it is rendered on the screen. After All this on page of my website it…
kunal
  • 11
  • 1
  • 2
0
votes
1 answer

React Navigation taking me to home screen from login screen even if the credentials are right or wrong. Also, no error Alert is being displayed

Loginhandler is the function which evokes after clicking log in button. Below are the pieces of two files. LoginScreen is my login.js file where as Action is my action file. I have made reducer file too, but my focus is to get the username and the…
0
votes
2 answers

Trying to use redux-thunk, but it displays error even though everything seems fine to me

So I am following a tutorial where redux-thunk is implemented, and have done everything as it is in the video, but I still get this error: Error: Actions must be plain objects. Instead, the actual type was: 'Promise'. You may need to add middleware…
reClicked
  • 15
  • 1
  • 6
0
votes
1 answer

Can't export action creator to component mapDispatchToProps method

In my action file I create a fetchMethod export const requestEmbedToken = () => (dispatch) => { return axios.get('http://localhost:7071/api/getTokens') .then(response => { console.log("token embed", response) …
infodev
  • 4,673
  • 17
  • 65
  • 138
0
votes
1 answer

blank page when deploying react-app into firebase hosting?

i have a problem related to deploying my react-app into firebase hosting , my react app is created with create-react-app, the build folder is ready and and i have successfully deployed my app to firebase , but nothing shows up , here is my…
Lcool
  • 321
  • 2
  • 5
0
votes
0 answers

How to use actionCreators with only Hooks in redux-thunk

I'm trying to use redux-thunk to getData asynchronously using hooks in redux. I can get it all working with connect() but useSelector/useDispatch is where I can't figure it out. codesandbox import React, { useEffect, useState } from "react"; import…
Advent
  • 45
  • 1
  • 6
0
votes
2 answers

Error thrown by Firebase is caught in then() of redux-thunk action

Firebase spits out an error if a request takes too long to resolve due to slow internet connections. Here is the error: @firebase/firestore: Firestore (7.9.2): Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error:…
dillon
  • 69
  • 5
0
votes
1 answer

react-native react-thunk triggering on initial component load and any keypress on an input

I'm a bit new to react, react-native, react-redux, and react-thunk and am encountering this strange issue which I can't explain. I have a sign-in component that uses a thunk to authenticate a user. I mapDispatchToProps and apply it to the component…
kisonay
  • 351
  • 2
  • 7
  • 15
0
votes
1 answer

Multiple actions in single dispatch (React-Redux Hooks)

I'm using react-redux hooks to write a login/logout system. Currently i'm facing a problem where inside the logout() & login1() will only run the first dispatch only. Did some research found that redux-thunks might can solve this, but get confused…
OMG
  • 3
  • 3
0
votes
1 answer

A cross-origin error was thrown while working on asynchronous http calls using react-thunk in codesandbox.io

I am practicing on API calls using react-thunk. but i am getting the following error. proxyConsole.js:64 Error: A cross-origin error was thrown. React doesn't have access to the actual error object in development. For practicing purpose i…
Thriveni
  • 4,183
  • 2
  • 14
  • 12
0
votes
1 answer

Restoring column state of Ag Grid with react redux

I am using Ag Grid in react+redux application. I need to make column state of the grid persistence. In other words everytime when user make changes with columns(order, sorting, hide\show, etc), application must save column state to DB. Then when…
KozhevnikovDmitry
  • 1,660
  • 12
  • 27
0
votes
0 answers

I have been getting loop on my error page when i click retry

When a new User register for the first time, and get an error during submition, This workas expected but after the user tap retry it just loop to error page (RegistrationFailure.js) but behind the scene there is an activity going on. I need help…
dilas
  • 11
  • 4