Connecting React to Redux
Now that you learned how React works and how to write dynamic components with it, we will look into connecting React to our Redux store.
Connecting a component to Redux will allow us to replace React's internal state management with Redux' state management. Sometimes, it makes sense to use React's state. For example, when you have a local timer or form validation. In other cases, when state is used across multiple components, using Redux for state management makes more sense. Redux works especially well with React because they share a lot of principles. However, you can use Redux with any library: React, Angular, Ember, jQuery, or even vanilla JavaScript.
Presentational versus container components
In the React bindings for Redux, there is a principle of separating presentational from container components (sometimes also called dumb and smart components). It is best practice to put them in different folders.
Presentational components are:
- Concerned with how things look...