After reading this post you will understand why Redux is used in conjunction with web frameworks and libraries like React.
Why Redux?
Class App extend Component {
state = {
name: ‘Vincent Sanders’
}
render () {
…
}
}
Now imagine working in a large codebase, where you have multiple components that may need to share various parts of your state. You will have to create a parent component, that is an ancestor to the associated child components, that maintains the state and passes the state down to the child components as props. As you add new features to your codebase, maintaining the state of your application within components can become a large task. This is where the value of Redux is realized.
Redux Value Proposition
Redux simplifies the state management process within your web app as there is only one state object for the entire app. Having a one central location to manage state removes the need for components to manage their own state. Redux stores are immutable and simplify testing and debugging within your application.
Have more questions about React-Redux? Contact us or checkout our other posts about React-Redux.