Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
2 answers
72 views

ReduxSaga makes my website re-render infinite

Im using Redux-Saga and Redux-Thunk, this is store I have configured, but it makes my website re-render infinitely. Can u tell me what should i do to solve that? Thank u. Store.js import { createStore,...
trungvs's user avatar
  • 19
0 votes
0 answers
109 views

Redux saga Method is being called twice(React Native)

Redux saga method is being called twice in React native application. Please find saga.ts export function* fetchValueLable(action: IFluxStandardAction<ILables>) { try { if (!action.payload) ...
Kartiikeya's user avatar
  • 2,516
0 votes
2 answers
337 views

How to call generator functions with React-Thunk

I'm in the process of converting some sagas to thunks. Some of these sagas have nested generator functions that I'm not able to call within thunks. Normally in a saga I do: const result = yield call(...
ertemishakk's user avatar
-3 votes
1 answer
179 views

Refactoring from Redux-thunk to Redux-saga (+axios)

I ask for help with the Redux-saga, namely with refactoring the code below. Any ideas or explanations are welcome. The code below gets a list of hotels from the API on request with parameters from the ...
mondevyat's user avatar
0 votes
2 answers
319 views

I want to use redux saga instead of redux thunk. Will this cause any problems in future in my application?

I'm usually used to React Saga so I want to use Redux Tool Kit and Saga. Butt is confused about whether this will be a problem later.
Rasel's user avatar
  • 1
2 votes
1 answer
1k views

When to use Redux-saga / Redux thunk and when not not? [closed]

to be honest I know when to use Redux and the global state, but I have been seeing a lot of codebases which are using Redux-Saga or Thunk for almost all the api calls everything is being saved on the ...
Ahmed Sarhan's user avatar
0 votes
1 answer
258 views

when we use createSlice we handle sideEffect using createAsyncThunk() function ,any way to achieve this functionality in saga style?

import { createAsyncThunk, createSlice } from "@reduxjs/toolkit"; import axios from "axios"; const initialValue = { value: 0, name: "praful" } export const ...
praful's user avatar
  • 51
1 vote
1 answer
897 views

Why we need to call api in redux thunk or saga why not in component?

when we need to some data through api and we use redux in react that time we use redux-thunk or saga but my qustion is it also possible through component useEffect hooks, we call api in useEffect and ...
praful's user avatar
  • 51
1 vote
0 answers
90 views

How to include React-Admin In Another Redux Application

I'm trying to embed react-admin into another redux application. The docs outline how to do this here. However, the main app located here uses configureStore rather than createStore. Moreover, ...
pandichef's user avatar
  • 796
0 votes
2 answers
576 views

redux-thunk: how to trigger on action?

I come from a background of working with react-saga, which has the concept of "effects" which lets us trigger action handlers in response to Redux actions being dispatched: take('MY_ACTION', ...
csvan's user avatar
  • 9,444
-2 votes
1 answer
289 views

(JS libraries) redux-thunk vs redux-saga [closed]

I am currently learning both libraries. What are the criteria for choosing which one ist best for my type of application? Redux-thunk has three times more weekly Npm downloads right now. Is there any ...
LarsOlt's user avatar
0 votes
1 answer
66 views

Redux TypeError: Cannot read property 'list' of undefined

I have created a simple website where you can track currencies and add them to your favourite list. I use http://api.nbp.pl/ for that. I was told to use redux for state management. the idea is that ...
WorstProgrammerEver's user avatar
2 votes
1 answer
3k views

What should I use redux-saga or redux-thunk in 2021?

Which one should I use? For more context I use redux-toolkit. Advices to help understand which tool fits better are appreciated
Dima Kambalin's user avatar
1 vote
2 answers
684 views

Typescript error when dispatching action created by createAsyncThunk from saga

Example: /* actions.ts */ export const getTeacherChats = createAsyncThunk( 'messenger/chats', async (params, thunkAPI) => { const response = await messenger.getTeacherChats() if (...
mr. gugr's user avatar
0 votes
2 answers
464 views

Reducer not getting called even after action is dispatched

My use case is that I want to clear some data from my state. For clearing the state, I don't need any api calls hence, I have not written any saga for it. Action.js export const remove = (payload: ...
Aayushi's user avatar
  • 1,806
4 votes
1 answer
3k views

createAsyncThunk: dispatch more actions after updating store with fetched data, within a same payload creator

I just started using Redux Toolkit(RTK), and I'm having a hard time figuring out a proper way of using createAsyncThunk from RTK. So what I'm trying to do is to dispatch an asynchronous action ...
jhkim's user avatar
  • 43
1 vote
4 answers
163 views

Should we be using redux in the following case?

I'm working on an enterprise application which is huge on forms, there are pages and pages full of forms. Normally when it's just form, we could simply use a library like formik or react-hook-forms, ...
user avatar
0 votes
1 answer
82 views

Using Redux-Saga in New Redux template react app

The new redux has a template built in for store and all the necessary thing to start a react redux app but it is using redux-thunk under the hood to make async calls. It it not possible to replace ...
Abhishek Subba's user avatar
1 vote
1 answer
2k views

after using swr doesn't even mean use redux-thunk or saga?

I am going to develop a panel with tables and many other components with reacted as spa and redux and other related stuff, I am going to use Swr(a cool package) for fetching remote data and cache it. ...
mazdak's user avatar
  • 185
2 votes
2 answers
2k views

Should I make all API calls with redux, or should I keep them simply in components? [closed]

I am new at using react/redux. I just started working on a react project, but I don't really know which one do I choose when when it comes to making API calls. Should I do all of API calls with redux ...
Charles's user avatar
  • 31
2 votes
2 answers
1k views

How to chain redux actions using returned result of the previous action?

I'm building an app in React Native, and using Redux with redux-persist to act as on device database. The crux of the issue is, how do I return the result of a redux action, to then dispatch another ...
fredrivett's user avatar
  • 6,558
-1 votes
1 answer
24 views

Redux with redux saga/redux thunk. Why some people says I shouldnt use thunk now because theres a saga

Im learning redux middleware, saga and thunknspecifically and I'm kinda confuse on why theres two exisiting middleware if they doing the same and benefiting your app. And I read some in the blog/post ...
Zowy's user avatar
  • 64
0 votes
1 answer
162 views

execute custom callbacks immediately after redux store update

How do I execute custom callback that is passed into an action through react comp, immediately after redux store update. The idea is say, I trigger an action from react, which will make network ...
Vignesh Sharma's user avatar
0 votes
0 answers
56 views

In React / Redux, how is race condition Ajax responses handled?

Does any existing react/redux related package handle Ajax race-conditions? If the user clicks on "Blue" or "Peter", and the screen is supposed to update info for the product to blue or show messages ...
Jeremy L's user avatar
  • 3,800
0 votes
1 answer
853 views

Do I need middleware like redux-thunk or saga? Angular-redux

Hi I'm developing an Angular website. I used Angular build-in httpClient library to make backend call. It return an observable. So I subscribed that observable and dispatch straight from that ...
Haha's user avatar
  • 146
0 votes
2 answers
334 views

Dispatch not changing object in Redux state

So I'm building an ecommerce app, and I have two values stored in the redux state to handle the cart. One is an array of objects, each of which contains two keys for objectID and quantity. The other ...
Stuart Johnson's user avatar
0 votes
2 answers
486 views

How to convert the thunk action to saga

I'm very new to redux-saga and am trying to get a simple demo working that makes an API call and performs pagination. It is my understanding that the redux-saga flow should work as follows. The Page-...
Saurabh Sahni's user avatar
0 votes
1 answer
63 views

Is it safe to edit same piece of state with two dispatches in a row

I'm using redux-thunk. I need to make a state empty and then fill it with data. For some reason, I have two separate actions for that, emptyName, addName. So what I was doing was just to dispatch ...
ILoveReactAndNode's user avatar
0 votes
1 answer
879 views

A way to handle async state updates on Redux store without using redux-thunk or redux-saga middleware?

I'm all in favor of NOT solving problems you don't have. So I started learning and using React without Redux. But now my app state has grown and I'm starting to face some state management issues. ...
cbdeveloper's user avatar
  • 31.1k
2 votes
1 answer
861 views

why to use redux saga or thunk at all

I am really confused by redux saga. So whatever article I look at they explain that it is there to fix the side effect of redux and asynchronous calls and even they give explanation on the difference ...
Learner's user avatar
  • 1,948
1 vote
0 answers
83 views

Wait for a specific property of the redux store to update from outside a React component

Normally what I will do inside a React component is to use the connect function to subscribe to the redux store, in that case I have access to the redux store and im aware when it's updating. I want ...
NyaSol's user avatar
  • 567
0 votes
0 answers
80 views

Using geolocation with react native & redux-thunk

currently, I'm working on a project using MapView, so I'm struggling to use geolocation.getcurrentposition with react native and redux-thunk, so if there's anyone who can help me I will be very ...
khaliloos benk's user avatar
0 votes
2 answers
2k views

A pattern to manage intial async actions with redux sagas for fetching initial data?

Until now I've been using redux-thunk for async actions. On application startup I use to have to load some data from some server. So what I do is to create async actions and then use async/await in ...
David Escalera's user avatar
2 votes
0 answers
297 views

With react-redux how do you implement immediate UI prior to asych update call to backend, then rollback if the update is unsuccessful?

With react-redux how do you implement immediate UI prior to asych update call to backend, then rollback if the update is unsuccessful? (currently using redux-thunk, but could look to another ...
Greg's user avatar
  • 34.8k
0 votes
1 answer
371 views

How to "use multiple redux-middleware" with reactjs app?

I'm using redux-thunk and redux-saga as middleware and my action call is successful but when I reload the page data is lost, the lifecycle method is called but it doesn't make a call to the server ?? ...
Mayur Sonawane's user avatar
0 votes
1 answer
3k views

How to handle erros with redux saga

I try to error handling with redux saga. Far now its always returning 404 error when i changed the api url. I organized my reducer and redux saga. but ı can't reach to fetching item This is my Reducer ...
ryouv's user avatar
  • 25
6 votes
3 answers
8k views

Error in <Provider> - Check the render method of `Provider`. react-redux

enter image description here Code: this is my index.js file index.js import { Provider } from "react-redux"; import { createStore } from 'redux'; import App from './app'; import ...
rohit's user avatar
  • 309
2 votes
0 answers
410 views

What is the best place to put pure and synchronous logic while using React with Redux and Redux-Saga?

After previously using Redux-Thunk, I've been playing around with Redux-Saga lately. So far I am loving it for handling asynchronous tasks like network requests. So in using sagas, I will definitely ...
Talha's user avatar
  • 817
0 votes
2 answers
1k views

redux-thunk and redux-saga simultaneously

I've come across two sources where it explains how to use two middleware systems together. The first one says: You can add the saga middleware right alongside the thunk middleware. Remember, the ...
Vladimir Topolev's user avatar
4 votes
2 answers
713 views

About Redux Async without middleware (redux-thunk, redux-saga... )

Some action have async function like fetch. But, i don't want to use middle ware like redux-thunk or redux-saga. So, i hesitate to use this code. /* actions */ ... export const fetchRequest = ({...
migos's user avatar
  • 86
0 votes
1 answer
395 views

Redux and React-Naitve: Cannot read property 'type' of undefined

I'm trying to set ducks and sagas in my first react-native application. But whenever I'm trying to call duck function, I get a red screen say: Cannot read property 'type' of undefined Redux store is ...
Rajdeep Ratan's user avatar
0 votes
1 answer
1k views

Which one is best to use Redux-thunk or redux-saga

I am very new to this redux.developed a project in flux now thought of upgrading it .I have used many API calls to get the data and used stores to get and retrieve data. Can any one suggest me to use ...
NAVEED's user avatar
  • 105
0 votes
1 answer
973 views

Error: Reducer "auth" returned undefined when handling "@@INIT" action. To ignore an action, you must explicitly return the previous state

Can't figure out what I'm going wrong in this. Just trying to setup the basic ducks and saga for my project practice. Ducks/auth.js const action = name => `/auth/${name}`; export const FETCH ...
Rajdeep Ratan's user avatar
1 vote
0 answers
653 views

restarting a queue of API requests if a token refresh happened

I'm having a hard time wrapping my brain around this pattern I am trying to implement so I'm hoping the stack overflow community might be able to help me work through a solution to this. Currently I ...
Jordan's user avatar
  • 2,513
0 votes
1 answer
716 views

Throtting same saga/epic action with takeLatest on different actions

I'm new on redux-saga/observable stuff. But I couldn't handle my scenario which looks so fit on these. So; I want to call API if any changes happen on the form. But I don't want to call API a lot ...
the_bluescreen's user avatar
6 votes
1 answer
6k views

identityserver4 with redux -oidc client requested access token - but client is not configured to receive access tokens via browser

My identityserver4 client looks like this: new Client { ClientId = "openIdConnectClient", ClientName = "Example Implicit Client Application", //AllowedGrantTypes = GrantTypes.Implicit, ...
Dayan's user avatar
  • 731
3 votes
1 answer
2k views

Using Globalized Redux Selector In Side Effect Creates Circular Dependency

I'm storing form data in redux store after normalizing it using normalizr. When I submit the form, I get the denormalized data using selectors inside my thunk and then send it to the server. The flow ...
ahmehri's user avatar
  • 796
1 vote
0 answers
211 views

Immutable.js not rendering list data

My reducer looks like this: import { fromJS } from 'immutable'; const GET_LIST = 'GET_LIST'; const initialState = fromJS({ list: [{ ID: 1 }, { ID: 2 }] }); function reducer(state ...
Dayan's user avatar
  • 375
0 votes
2 answers
2k views

Redux-saga: Calling a saga outside the redux middleware environment

Pretty new to redux saga - I'm trying to figure out how to call a saga outside the redux middleware environment when I have access to the store. After reading the redux saga docs looks like I have ...
InquisitiveGirl's user avatar
11 votes
4 answers
8k views

how to setstate after saga async request

I'm using redux-saga in my project. I used redux-thunk before, so i can't setState ends of some async request. like this.props.thunkAsync() .then(){ this.setState({ '' }); } Since thunk ...
godsenal's user avatar
  • 387