Redux is a pattern and library for managing JavaScript application state, using events called "actions". It serves as a centralized store for state that is needed across your entire application, with rules ensuring that the state can only be updated in a predictable fashion. Redux make it easier to understand when, where, why, and how the state in your application is being updated, and how your application logic will behave when those changes occur.
I am trying to achieve infinite scrolling when user reaches the bottom of the page. When I get to the bottom of my page, page increments and I make a new request to get new items correctly. However, ...
I have problem configuring connect-react-router. I keep getting Error: Could not find router reducer in state tree, it must be mounted under "router".
I'm using react, redux-toolkit, ...
I'm creating a system with react & redux where i need to fetch some data from an api, i made the action/function and reducer but when i try to access the results on my component and console log ...
I am trying to remove an array of id's that has to be removed in the backend. I am going to use an endpoint that will take this and execute the delete request with redux. It will be at the endpoint:
...
I encounter some issues when I try to implement a file uploader in my react-redux application.
Until now, I have handled all the other inputs in this way :
All the inputs have a name and a value. When ...
I'm using redux-undo to manipulate active/inactive button states when user click browser back/forward buttons. My function changeButtonImage() change active/inactive menu-button images depending on ...
I want to employ openapi codegen in my React application. I use openapi-generator-cli to generate a code based on a schema. The generator creates functions that build QueryConfigs for me. However, I’m ...
asked 8 hours ago
zefciu
1,82922 gold badges1515 silver badges3737 bronze badges
I created a redux store with 2 different "Slice". First, I have an appSlice:
appSlice.ts
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import type { RootState } ...
I am using firebase for my authentication and react, redux for my app. When a user get authenticated auth reducer get updated. But when I refreshes the page it resets to the INITIAL_STATE. I want user ...
I'm trying to use useSelector hook from react-redux with a selector from redux-toolkit slice in my custom hook and i'm getting the following error.
TypeError: Cannot read property 'isLoggedIn' of ...
Hi developers I am currently studying react js with redux for frontend and I want to implement state management (Redux) to my sample project. My Backend I use laravel. Now I already set the Action, ...
asked 20 hours ago
DevGe
95611 gold badge1515 silver badges3838 bronze badges
This kind of problem has been answered before but I could not find a general way which works for all. Here is the state value screenshot:
The value came from node.js as
return res.send(...
asked 21 hours ago
mlhazan
49022 gold badges77 silver badges1919 bronze badges
I have a problem with filtering my data in redux store. I have to filter added films by favourite.
Even console.log(newState) dont show filtered data. Maybe sth is wrong with filter() method? Any ...
I am new to Redux so finding it hard to troubleshoot where the issues are in my code especially since I have no errors.
Whenever I add a product to the cart my state is updated however it only updates ...
I need to throw a validation error from my custom input component, and not let the user successfully submit the form. In this Codesandbox, I'm passing the maxLength prop to the Field with a custom ...
asked yesterday
Laura
30522 silver badges1111 bronze badges
I'm using Redux DevTools to track the state changes in my application.
I know that I can track changes in my application's state once my application is loaded:
Open the State tab
Expand the state ...
asked yesterday
adamgy
1,71711 gold badge88 silver badges2121 bronze badges
I am in the process of setting up and implementing redux in my ecommerce project, and currently I am trying to get it set up so the UI updates the BasketBadge I created to display number of items in ...
How do I call a variable, such as device_id, device_name, or group_id within the device state in Redux?
{JSON.stringify(device.deviceData)} works great and displays all the state information within ...
I am building a dynamic submenu for a dropdown using React and Redux. The plan is that when the user clicks on dropdown menu, an API call will be made and based on the response of the API, a submenu ...
asked yesterday
Souvik Ray
2,24911 gold badge1616 silver badges4141 bronze badges
I'm struggling to find the right type for my return type of a AsyncThunkAction to use it with the unwrapResult method of Redux Toolkit (see: Redux Tookit: Unwrapping Result Actions):
Declaration of ...
What happens to the state from redux when we trigger an action?
We have the current state of redux
We call the action
Each reducer looks for its own case in the switch that contains the correct ...
asked yesterday
Paweł Baca
55911 gold badge77 silver badges2020 bronze badges
I have a signup page signup.js after successful sign in I need to take those data to another route view sign in details page if I render sign in details then I am viewing it in the same page how to ...
I've got a state in my Redux store shaped like this:
type RootState = {
PAGE_A: StatePageA,
PAGE_B: StatePageB,
PAGE_C: StatePageC,
// AND SO ON...
}
Each page is a slice created with createSlice ...
asked yesterday
cbdeveloper
13.2k1010 gold badges4949 silver badges131131 bronze badges
I have an web app with multiple features like private messaging, buying, offers etc. I want to make it to work real time so I decided to use socket.io. I use redux for global state management, but I ...
I am learning NGXS state management but cannot understand the meaning of DISPATCH word in this context which has been written on its documentation. Could you please clarify for me.
As I mentioned ...
asked yesterday
Mohsen
46844 silver badges1515 bronze badges
What exactly does action do in this reference:
export function productsReducer(state = initialState, action)
I'm new to Redux. I have a reducer with an initial state with 2 properties.
From a component I send data to store, but only one of the properties is delivered - either time or date. But I need to send ...
When trying to clear all items with a click of a button in React with a for loop, it is acting really weird in that visually it only removes one item. However, if I refresh the page, all items are ...
I have used Redux Createslice for actions and reducer in my React app. Till now I had functional component where I used useDispatch to dispatch all actions. But for capturing errors have used ...
I am following this tutorial on youtube to implement redux for my ecommerce project. I have followed exactly how the instructor does it however when trying to add a product to the cart I get this ...
I'm using React and Redux to fetch data from my parse server. The dispatch is being dispatched fine but im not able to display the data from mapstatetoprops in the function. Is there something im ...
I am new to Redux and Ngrx. I have seen several questions but none answers my question. I still do not fully understand why one would need NGrx in angular. To me, it sounds like Redux is a singleton ...
asked yesterday
YulePale
3,32955 gold badges2323 silver badges5858 bronze badges
Hello now I'm studying ngrx, but I have a big problem. I don't know how to fix it. someone who can help me plz...
I got TypeError: action.payload is not iterable error. if I change [...action.payload] ...
I am using material-ui theme along with redux-toolit in gatsby.
My theme.ts file:
import { createMuiTheme } from "@material-ui/core";
import { useSelector } from "react-redux";
...
I'm planning to create a new project which is something like management system panel for my company's license. I will use React for my client side and I would like to use state management system but ...
I am new to redux. I would like know how I could create my own enhancer in redux. I didn't find any example to create enhancer. To create enhancers, So what arguments do I need to pass and what do I ...
asked yesterday
porpor
26233 silver badges1313 bronze badges
I am very curious about the pros and cons of using the function like below instead of creating a new class instance for Redux store. What is the consideration behind this design?
function reducer(...
I want to introduce integration testing with React Testing Library into my app, but I'm running into some high-level roadblocks.
The examples in documentation are great, but I feel like there isn't an ...
I am not a backend developer, and I am new to Redux. But I cannot figure out how to get a user registered in my application with redux. I am seeing the 'auth' state in my Redux Dev Tool, so I know it'...
I'm wondering what the best practice is for using React Redux's new hooks (https://react-redux.js.org/api/hooks). For selectors, I know I can just do useSelector(selectUser()) but I'm considering ...
I am looking for a best practice or recommended approach to handle pre-condition actions where, based on a condition, a pre-action must be dispatched and finish (reduced and side-effects) before the ...
I have differentiated the users with normal user and admin. a normal user can't access to the admin route while admin can access the admin route. when i try to implement there is a problem with ...
I've been trying to dispatch a function that will call an async parse cloud function. It worked well in my other projects when i used them in functions. But this is the first time i'm using them in a ...
There is some issues with state in Redux. I want to change color of a component with state update. But the state in TargetList.js has error: TypeError: Cannot read property 'includes' of undefined.
...
I have an application built in React and Redux that's been working fine until I implemented a simple localStorage check to render either the App or an auth page I've called Gateway:
App.js
import ...
I have a vehicle form component that asks for the year, make, and model. After user selects the year I am dispatching a redux action to fetch all makes for that year, and then after selecting a make I ...
I'm a little confused and don't know why my function isn't working.
In fact I want to redirect the user to the login page if a token is not in LocalStorage.
I use Redux, so a authReducer and a ...
I want to access this _id attribute from my state (userLogin --> userInfo --> _id). Could someone please show me how to do this? I have labeled where I would like to access the attribute. Thank ...
Scenario is user related details are stored in a reducer. When a User A log out of the device and User B logs in to the device, the data gets wiped off and new user data gets stored in the reducer. ...
asked 2 days ago
FortuneCookie
72022 gold badges1212 silver badges3434 bronze badges
I am using react and redux in my project i already integrated complete backend in spring boot
and by following this tutorial i am trying to integrate frontend in react https://stripe.com/docs/stripe-...