Questions tagged [redux]

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.

Redux is a pattern and library for managing and updating application state, using events called "actions". It serves as a centralized store for state that needs to be used across your entire application, with rules ensuring that the state can only be updated in a predictable fashion. It is inspired by the architecture.

The patterns and tools provided by 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. Redux guides you towards writing code that is predictable and testable, which helps give you confidence that your application will work as expected.

Redux Toolkit is the standard approach for writing Redux logic. It provides utilities to simplify several common Redux use cases, including store setup, defining reducers, immutable update logic, and even creating entire "slices" of state at once


Useful Links

Related tags

35457 questions
7
votes
3 answers

NgRx Get value without subscribing

I am working my way through some ngrx tutorials and I think I'm starting to get my brain wrapped around it. What I don't understand is how to do something as simple as getting a value from the Store: Goal: Get a value from the store without having…
mwilson
  • 12,295
  • 7
  • 55
  • 95
7
votes
1 answer

After adding StoreModule.forFeature (...) can not access to stored data

I have multiple projects in one angular 8 app... Until now, I have in only one project @ngrx/store but now I added @ngrx/store in every project and because of multiple stores, I need in every projects in app.module import…
Arter
  • 2,224
  • 3
  • 29
  • 66
7
votes
1 answer

React useSelector first returns undefined, then returns object

I'm trying to extract data from state. I'm using redux. const {currentPost } = useSelector(state => state.posts) I expected to get an object with properties. Instead I get couple of undefined and then I get an object. These undefined on the start…
ArcMech
  • 475
  • 1
  • 5
  • 16
7
votes
3 answers

How to execute store.unsubscribe from useEffect using React hooks and Redux

I have a React stateless component using redux and hooks. I need to display the number of items on page load (useEffect) and update it every time I add or remove an item (store.subscribe) useEffect(() => { setState({ items:…
user3174311
  • 1,714
  • 5
  • 28
  • 66
7
votes
4 answers

redux-devtools-extension not working in chrome devtools

I'm using redux-devtools-extension to develop a React Native app: In the React Native debugger it works and you can see window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ and window.__REDUX_DEVTOOLS_EXTENSION__ are defined correctly. In the chrome…
7
votes
1 answer

How to get Ant Design Form data in another Component

I've created a form using Ant design's Form.create() and i want to access it's field's values in another component. Using redux, i can do that using: function mapStateToProps(state) { return { formStates: getFormValues('form')(state), …
Taha Moumen
  • 79
  • 1
  • 2
7
votes
2 answers

How to listen to certain action in redux

I am using React and Redux (react starter kit). I have a set of action, and when some are called, I want to dispatch side effects. For exemple, I have a workspace that contains projects, if workspaceID in the store change, (using my action…
Bobby
  • 4,372
  • 8
  • 47
  • 103
7
votes
1 answer

Typing mapStateToProps React Redux

I am not able to type the "state" parameter of a mapStateToProps If I just change state : any instead of state: AppState it works and no error. But I would like to have a correct typing for my state parameter. For now, I have this error on the…
Topsy
  • 1,023
  • 1
  • 11
  • 26
7
votes
2 answers

What is the proper way to chain action in rxjs / ngrx effects

I'm a bit struggling here : I'm inside an ngrx effect, i want to authenticate with my service, and with my answer from my service, dispatch to actions to retrieve information and only then dispatch an action of type "YEAH LOGIN IS OK" this is my…
Razgort
  • 428
  • 1
  • 7
  • 18
7
votes
3 answers

Class component with Redux

I am new to React and Redux and as we know, it is best to use class component for those components that have state and the question I would like to ask is that Is it recommended to use functional component for components that have connection and…
Dickens
  • 895
  • 3
  • 11
  • 25
7
votes
2 answers

How to update React component after changing state through redux?

I was learning React and Redux and while doing that I decided to make webpage with a button which on clicking would change the state. Below the button I wanted to display the current state in a different component. Though the button on clicking…
Tarun Khare
  • 1,447
  • 6
  • 25
  • 43
7
votes
2 answers

redux-persist/createPersistoid: error serializing state TypeError: Converting circular structure to JSON

I am trying to integrate redux-persist to my react-native project. The aim is to persist the redux store's data between application re-launch so that user does not need to log in each time they launch the app. Also, I want to store the previously…
honor
  • 7,378
  • 10
  • 48
  • 76
7
votes
2 answers

Make two grid items for Material-UI both same height with Flex-box

I have two grid items that I want to make the same height by trying to use flex, however nothing seems to work. I believe I might now be using the Grid element in Material UI correctly. I have tried using the height and width properties as well. …
user2892804
  • 133
  • 1
  • 2
  • 11
7
votes
1 answer

Logging to Device in Production React Native Expo App

Question: How can we log messages and save it on the device for a production React Native Expo app? Requirements Store log files on the mobile device (Ideally) Log rotation, compression and/or pruning Log files can be sent to a remote server…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
7
votes
1 answer

Error: Before running a Saga, you must mount the Saga middleware on the Store using applyMiddleware

I wrote a simple counter app. I tried to add a saga middleware to log actions. Very basic app, but i nice structure. When I add a middleware something went wrong: I had the error: redux-saga-core.esm.js:1442 Uncaught Error: Before running a Saga,…
Matteo Fioroni
  • 103
  • 2
  • 4
1 2 3
99
100