React Redux
State Mangement simply mean manage the data our App Relies on.
e.g-->
State can be complex and it's important to understand which problem's state management solution like actually Redux solved.If we had an App like this where you have two different areas one where you manage your users, where users can signin,manage/see their Dashboard and one where you have products in a list which users can add to a cart then these areas are actually not totally independent but in your App they will be render on different screens so pretty separated from each other but the question whoever user signedIn which we need in Authentication might also be relevant in another part of Application now we normally passed data from A to B to C to D and so on through props, it's not really very convenient.Instead we want to have a Application setup where something changes.
for e.g-->> where user signed in
in our Application at a certain filter and then this information is kind of propagated to our App and automatically passed to the placed where we needed but not through props but with some behind the seems mechanism regarding this.where Redux is a common solution in React and React Native Apps to manage the state.
Qno--> Now, how does Redux Work?
Ans--> first thing first, Redux is a 3rd party library which we can add to React and React Native to used it there and it's all about having a Central Store.Redux introduces a Central Store in memory(javascript memory) but not database.where our Application State so the data different parts of our App can be stored in and then when in one component we want something to manipulate that state
for e.g--> setting a filter for marking a data.we then dispatched so called Actions(pre-defined information package, having certain a schema) which can be handled by Redux as configured by us.this action reaches a Reducers, and we will be the one writting this as a developer and so we can control which kind of action/Reducer accepts
so which kind of information package
our Reduce requires and that reducer then receives the action and derives a new state based on the old state which then update this centrally store state.So, reducer is there to update this state in the end.when that store changes/when the state in their changes we can also have
subscriptions to the store from other components these subscriptions will be triggered when our store and our state there changes and the updated state is then passed on to the places in ou App/Component who interested in this changes.
This is how Redux works and that's the idea behind the Redux.
Nice , Keep up the good woek