Conteúdo do Curso
Introduction to Redux
Introduction to Redux
When to use Redux?
Redux is a great tool for state management, however we should be careful about when to use it. As discussed before, it is a tool used for managing states in large applications.
Implementing Redux in a small application might not be too useful, unless we have to manage a lot of states. In larger applications we will inevitably need a proper system for managing states otherwise it will become difficult to debug and expand.
Implementing Redux in a React application is more work in the short term but pays off in the longer term in the case of larger scaled applications.
We can consider these two basic points when deciding about using Redux:
- There is a considerable amount of data changing over time;
- There is a need for a single source of states and a system for easily managing them.
As demonstrated in the previous chapter, we can use top-level components in React as a source of multiple shared states, but it gets unorganized and hard to maintain eventually. Redux has the upper hand in this case since it’s designed exactly for that.
Obrigado pelo seu feedback!