Quantcast
Channel: Understanding React-Redux and mapStateToProps() - Stack Overflow
Viewing all articles
Browse latest Browse all 11

Answer by Mohan Krishna Sai for Understanding React-Redux and mapStateToProps()

$
0
0

Yes, you can do this. You can also even process the state and return the object.

function mapStateToProps(state){    let completed = someFunction (state);   return {     completed : completed,     }}

This would be useful if you want to shift the logic related to state from render function to outside of it.


Viewing all articles
Browse latest Browse all 11

Trending Articles