Questions tagged [redux]

Redux is a predictable state container for JavaScript applications based on the Flux design pattern.

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

redux hooks for functional component

I tried to convert redx into redux hooks. so I researched and found this link https://medium.com/javascript-scene/do-react-hooks-replace-redux-210bab340672 I was able to make few changes. but not able ...
0
votes
0answers
7 views

ssr+redux-saga - Actions must be plain objects. Use custom middleware for async actions

I'm working on an application based on ssr+redux-saga. And I have error: "Actions must be plain objects. Use custom middleware for async actions." In the process of research, I came to the conclusion ...
1
vote
2answers
36 views

Awaiting Multiple Axios Calls before Dispatching Action in React Redux

I have a React Redux app that needs to call multiple API endpoints using axios, await the results from these API calls, then dispatch an action. Problem: In my current implementation below, it ...
0
votes
0answers
8 views

Dispatching store actions from API methods that are imported in Sagas causes dependency cycles

I have a React application with API methods based on socket.io. File webSocket.js handles Socket connection, as well as basic methods like sending and getting the data, which are used across all of my ...
-2
votes
1answer
15 views

What problem does `react-redux-firebase` solve?

I'm new to all of these technologies, but as far as I understand it, you can use React Native with Redux and Firebase without react-redux-firebase. You could just use react react-native redux react-...
0
votes
0answers
15 views

Multiple NGRX Entities in Feature Module - Reducers won't addOne()

I've read all the previous questions suggested by SO, but I just cannot get it to work. So here's the problem: Reducer 1: export interface ApplicationState extends EntityState<Application> { ...
0
votes
1answer
26 views

Adding reset password functionality to react / redux login functionality

I used the following login with react/redux tutorial to build a signup / signin functionality into my React app, however I did not realize until recently that I now also need a reset-password / ...
3
votes
2answers
39 views

How to use combineReducers with handleActions

I'm trying to create new reducer survey, which must combine name and questions reducers while using handleActions from redux-actions package. But I recieve an error Invariant Violation: Expected ...
0
votes
1answer
34 views

Can't save user data from backend to the redux state as long as the user is authenticated

I want to show the user name on the home page when he authenticates, so on the backend and at the login endpoint i put a user object in the json response (res.json) containing the name and email of ...
0
votes
2answers
21 views

Does react component gets unmounted and remounted whenever redux store is updated?

My component has a button. By clicking the button, an action is dispatched and corresponding API call is made. Response from the API call is stored in redux. But whenever there is an update to the ...
1
vote
1answer
21 views

How to call functions with API calls in an action using Redux-hooks useDispatch from component?

I'm doing a project using redux-hooks, I m new to redux-hooks. I am having actions.js file having different API call function. and to dispatch the action from a component using useDispatch(). do I ...
0
votes
0answers
18 views

Memoization not triggering with new input

const getGeoData = ( pollutant: Pollutant, legendMinMax: { min: number; max: number } | null, year: number, airbaseStationTypes: AirbaseStationTypes, ) => { if (!legendMinMax) return new ...
0
votes
0answers
19 views

Redux - Ngrx action dispatch asynchronous treatment

I have a time slider that trigger action to filter data every change this.selectedDate$ .pipe( switchMap(elm => { this.selectedTime = elm.timeSelect; this.store.dispatch(new ...
1
vote
2answers
38 views

How to set focus on rendering redux form dynamically created in loops

I am using Redux-form, I need to set focus on the text box when rendering on button click, I have already using autoFocus but it will work on the second index of the loop also i have used document....
0
votes
2answers
44 views

How to access redux store in custom api handler react javascript class

I am working on react native app. I am storing accesstoken in store after login. In every api call i have to pass this token as a header, but token has some expiry. So i have written one Apihandler ...
0
votes
2answers
37 views

How can I convert this object to an array and access values by key in React?

I have an Object with a lot of keys. I need to convert this object to an array of objects but in such a way where I can still access the values for each object by the key. I want to go from: {'A': ...
1
vote
0answers
28 views

How do I implement Redux async middleware with Typescript?

I need some help with TS. I migrate one of my project to TypeSctipt. The app is on React+Redux stack. I have my custom fetch middleware which is something like this: import { Action, Dispatch, ...
0
votes
1answer
46 views

React Component not re rendering when the state got updated

The React component is not rendering when the redux store is getting updated. If I am using set timeout I can able to see the data in the console. Why the component is not rendering. What is the ...
0
votes
1answer
16 views

findIndex keeps on returning -1 from json

I'm passing a some context data from redux state (using hooks) to my current component. I need to find only a specific value from redux state and put in the local, component's state. I'm using ...
0
votes
1answer
25 views

Accessing Redux Store outside of React Component returns initial Values

In a React Redux app based on the Keftaa/expo-redux-boilerplate boilerplate that uses redux-persist, how can we access the persisted Redux store from a non-React component? Problem: I am not sure how ...
0
votes
0answers
23 views

in child component I am not getting values inside componentWillReceiveProps

I have two different files in thse same component. in that index.js is the parent component. Animal.js is the child component. in index.js I am getting values inside componentWillReceiveProps. console....
0
votes
4answers
56 views

How add item in nested array of object in redux reducer

Here is my example initial state: let initialState = { data: { name: 'john', books: [ { name: 'a', price: 220 } ...
0
votes
0answers
26 views

How to share Redux store between JS app and Angular app? [on hold]

I have 2 applications: 1: is built in JavaScript and dot net 2: built in angular 7 I want to share Redux state from angular to JS app and vice versa Is it possible? How can I do it? Any code ...
0
votes
1answer
20 views

How to share Redux logic between React and React Native

I am trying to build a boiler plate for either back-end and front-end (web with React and mobile with React Native). I would like the front-end to have a shared directory for Redux files. But when I ...
0
votes
0answers
19 views

Implementing React native maps with redux

Can anyone recommend me some articles / docs or (better yet) tutorials on a comprehensive implementation of Redux with React-Native-Maps? I am currrently working on a project that would requires such. ...
1
vote
2answers
44 views

Trouble changing toggle value from active to not active

Background I have added a toggle button in my Redux app that allows someone to toggle whether they like a specific tv show or not. When I click the button once, I can toggle it on (make the button ...
0
votes
1answer
12 views

props in functions not calling the function

I'm trying to fix a problem from the code and don't understand why is not working. Function: export const monthlyKpiActions_disp = (threeMonthsBefore, currentDate) => { console.log('...
0
votes
1answer
29 views

NGRX REDUCERs using SAME STATE object

I will reformulate the question: Got these two reducers: export function reducer1(state: State = initialState,: Actions1.Actions1); export function reducer2(state: State = initialState,: Actions2....
0
votes
4answers
47 views

are javascript const really constant? in redux?

I have this reducer in my store, where the initial state initialProcessingState is imported from another source file. import { ACTN_IS_PROCESSING } from '../config/action-types.js'; import { ...
0
votes
1answer
20 views

Unable to change state when combining multiple reducers

I have two reducers: // reducer/reducers/credentialsErrorDisplay.js export default function credentialsErrorDisplay(state = 'none', action) { switch (action.type) { case 'FLAGCREDENTIALSERROR':...
1
vote
1answer
39 views

How to fix 'First visit render data isn't accessible, but after second visit it is accessible for rendering' error in React-Redux

---------------------------------------------------------------------Working Project available at codepen.io: https://codesandbox.io/embed/happy-tharp-slvf5 --------------------------------------------...
0
votes
1answer
23 views

Why deployed react app on gh-pages is showing blank page on different browsers while showing correctly on my browser?

I have followed github pages deployment instructions and it's deployed correctly. But when I open the homepage link on another browser it's showing blank page. my package.json file provided below ...
0
votes
0answers
20 views

How can I get the current state in my product reducer and pass it down to my cart reducer such that when users add new item i can add the new item

I have problem passing the states between two reducers in redux I have the state working properly in my product reducer and the products are fetched in the homescreen... but then i have mulitple ...
0
votes
0answers
84 views

Response headers return text/html instead of application/json

Making a full stack Todo app with the MERN stack and using Redux for state management. I'm trying to implement the edit functionality on my todos. App is pretty simple CRUD app for now. Double click ...
1
vote
3answers
49 views

React component does not update with the change in redux state

I have a cart data in this form const cart = { '1': { id: '1', image: '/rice.jpg', price: 32, product: 'Yellow Corn', quantity: 2, }, '2': { id: '2', image: '/rice....
0
votes
0answers
7 views

Use action creator to dispatch action in another action creator

I'm wondering if there is a pattern that allows you to use action creators inside of other action creators. The modifyMassProperty action creator lets you pass any number of actions which are then ...
0
votes
0answers
13 views

Combine observables across function call of wrapped “catchError” handler

I'm implementing a global error handler for all of my epics, which should handle session errors. My problem is how to combine observables of redux actions in my wrapped "catchError" function. I would ...
0
votes
1answer
26 views

Is it possible to pass two form name in on “formValueSelector” Redux form

I have created a forum section and want to use it with two different forms. My problem is can we pass two form name to "formValueSelector" I have two forms name a and b and curruntly I am able to ...
0
votes
0answers
24 views

Access persisted store when app is closed

Currently, I am using redux-persist to store data locally. I want to access persited store when app is closed like when a there is a new push notification. I have tried accessing store using ...
0
votes
0answers
30 views

Redux “Basic Tutorial” project set up

Even though I have worked in a React/Redux environment and have a basic understanding of the Redux library I have decided to revisit the Redux documentation as I do not know the library as well as I ...
0
votes
1answer
27 views

How to implement Route Navigation with async_redux

I´m new in Flutter and Dart and i found a new "async_redux" package in https://pub.dev/packages/async_redux by Marcelo Glasberg to develope my project easier way than traditional "redux" package. In ...
1
vote
1answer
39 views

Does changing reference of nested object is changing reference to root object?

I'm not fully sure how I can test that - Please advise Lets say that we have object X { a: { b: { c: true } } } Then we are mutating it so we are having object Y ...
0
votes
0answers
26 views

React Redux Dispatch not updating store as expected

Currently have an implementation where i need to persist some data, then depending on the user action, this data needs to be cleared. I can clearly see that in the action, the data is cleared and ...
0
votes
2answers
37 views

How do you dispatch an action along with a DOM event?

I'm picking up working with react and redux, while handling state locally I am able to pass events along with onChange handlers so as to access the value with event.target.value and set them to state. ...
3
votes
3answers
35 views

How change value of nested array in redux reducer

I'm trying to figure out width update value of item in nested array of reducer and change value. Its my reducer state: let initialState = { data: { users: [ { id: 1, ...
-1
votes
0answers
27 views

How to add a `npm run watch` command in Create-react-app

I am using react-app-rewired with customize-cra to add a seperate config file for react app. The react app is built useing create-react-app. My problem is I want to add a npm run watch command in ...
1
vote
1answer
32 views

How to test a React component that renders a Redux-connected component as a child without providing mock Redux store?

I have a React component like the following: Component1.js import React from 'react'; import Component2 from './Component2.js'; const Component1 = () => (<div data-test="component1-component"&...
0
votes
1answer
23 views

Route not rendering even when window URL is changed

When I navigate to the same route twice even though the URL is changed, the components are not re-rendered. For example: Navigate to /dashboard/ this works click a link to /dashboard/project/...
1
vote
1answer
18 views

How update value in redux reducer if it's inside of object

if i have a state in my reducer like: let initialState = { data: { name: '' }, }; how i can update name value with action.payload ? i tried these things but it's giving syntax error. case ...
-1
votes
1answer
21 views

Type-checking a TypeScript reducer receiving action types

I am trying to create a TypeScript redux reducer that accepts an actionType as a key value, however I am struggling to define the proper interface for my state. When doing so, I am getting the ...