Redux for React: A Simple Introduction
Plus quickly Integrate Redux with included template files
Introduction
A state management tool becomes a necessity in React apps as your state increases in complexity, one such solution being Redux. Redux allows you to manage your entire application state in one object, called the Store.
Updates to the Store will trigger re-renders of components that are connected to the part of the store that was updated. When we want to update something, we call an Action. We also create functions to handle these actions and return the updated Store. These functions are called Reducers.
Having a “State Tree” as opposed to hundreds of states in hundreds of components makes a lot of sense. However, you are not forced to only use Redux to store your state: there are a few scenarios where using a global state object does not make sense, like forms.
Why? Forms are isolated pieces of your application, the state of which is not needed to be known outside of that form. (No external components need to know what fields have been validated, whether the form is submitting, the values of that form, etc). It is the result of the form that would be of use, as the app relies on that result to make changes to its state.