DEV Community

Discussion on: Getting started with state management using Redux

Collapse
 
curiouskaran profile image
Karan Sharma

Nice post Emma. Just one thing I would like to mention is while using mapStateToProps we may also have a need to use the props of the connected class. we can get those by using ownProps as a second argument in the function as below.

const mapStateToProps = (state, ownProps) => ({
name: nameSelector(state ?? ownProps),
});

Collapse
 
emma profile image
Emma Goto 🍙

Thanks! That's a good point to call out.