Redux
In React, data flows in a unidirectional manner, which we covered in an earlier topic in this chapter. Now, if you get a scenario where a child component has to notify its parent or any other component regarding its state change, what will happen in that scenario? React does not support data flow from a child component to its parent's component, not even to other components.
Here Redux library comes into the picture. It provides a way for all the components in the application to talk to each other. Let's now explore the architecture of Redux.
Architecture of Redux
Redux comes up with a solution to React's unidirectional data flow. The solution is that all the components should maintain their states in a global place, which will be called the Store. The responsibility of the store is to get updates from the components. Components send updated data to the store, which is also called Dispatch, and the components that need to know about such changes should register with the store to receive...