Leave a Reply

125 Comments on "React JS / Redux Tutorial – 9 – Actions and Action Creators"

Notify of
avatar

David
Guest
David
14 days 23 hours ago

3:47am! 🦉

Puni Charana
Guest
Puni Charana
3 months 13 days ago

why not just use this.props.dispatch({type:"ACTION_TYPE", payload:{}}) 7:06 instead of creating the extra function.

Cory Baker
Guest
Cory Baker
3 months 21 days ago

bro wtf is wrong with you

Awa Melvine
Guest
Awa Melvine
3 months 25 days ago

In some cases, instead of fully defining the mapDispatchToProps function as you did, one can just pass an object as the second parameter to the connect function, containing all the action creators. Something like this:export default connect(mapStateToProps, { selectUser, someOtherActionCreator })(UserList);as opposed to this:function mapDispatchToProps(dispatch) { return bindActionCreators({selectUser}, dispatch);}export default connect(mapStateToProps, mapDispatchToProps)(UserList);Can someone help me confirm and explain this?​ In what cases can we use the shorter version, the one that doesn't need you to define the mapDispatchToProps? Thanks for any clarifications 😀

Awa Melvine
Guest
Awa Melvine
3 months 25 days ago

You have a gift for explaining stuff, Bucky. Great job!

jking54321
Guest
jking54321
5 months 3 days ago

Thank you so much for showing what I was missing, bindActionCreators. I was following other guides on hooking up redux to a react app they left that out or were using decorators to connect. No actions will be dispatched without that.

Rob V
Guest
Rob V
5 months 26 days ago

React js demos, code, tutorials,…  Helped me a lot – Happy Coding!  yamechanic.com/1aRD

Rob V
Guest
Rob V
6 months 5 hours ago

REACT code, Tutorials, Demos,…  Helped me a lot – Happy Coding!  yamechanic.com/1aRD

Rob V
Guest
Rob V
6 months 2 days ago

REACT code, Tutorials, Demos,…  Helped me a lot – Happy Coding!  yamechanic.com/1aRD

SHEHAN GOMES
Guest
SHEHAN GOMES
6 months 27 days ago

Thanx bro

1 2 3 9
wpDiscuz