I don't like diluting quality content, so I will be brief and link to a great article on the benefits of adding selectors to a react/redux application and how to do so.
Selectors:
- act as a single-source-of-truth when mapping to your mapStateToProps() (very useful if being referenced in many components)
- handle the logic for determining what state data you want, making your components less complex
- can increase performance by only performing computation if the state arguments it is passed have changed since last time
Redux Selectors: A Quick Tutorial
Note - Only worry about this if you are already proficient with React and Redux
Top comments (0)