Leave a Reply

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

Notify of
avatar

Justin E. Samuels
Guest
Justin E. Samuels
3 days 44 minutes ago

Has to be the worst Redux tut I ever went to, jeesh

Michael Kronenberg
Guest
Michael Kronenberg
1 month 16 days ago

Dude u save my day !!

Gerald Onyango
Guest
Gerald Onyango
2 months 13 days ago

Thank you for these videos, they helped me get started with redux. I'm working on this app and I'm wondering what the best way would be to pass multiple actions in bindactioncreators?

Prabhas Joshi
Guest
Prabhas Joshi
15 days 14 hours ago

the first argument to bindActionCreators is an object of all the actions that you want to be available in this.props:so pass it multiple key value pairs in the call:const matchDispatchToProps = (dispatch) => bindActionCreators({ fetchUser, setUserName, setUserAge }, dispatch)also, in es6 if the key and value names are the same then we can omit writing both and just write it once,let x = "a"let obj = {"x":x}//in es6let obj = {x};and we can also omit writing the brackets of a function if there is only 1 return statement.So there you go

Ian Harris
Guest
Ian Harris
2 months 14 days ago

learning so much from these videos. thanks Bucky. except every time i watch one i keep thinking of that one video where you went off on a side note and told the story about that puss-filled chicken sandwich your friend bit into. i've been unable to eat any variety of chicken sandwich from any fast food restaurant since.

amir mousavie
Guest
amir mousavie
2 months 24 days ago

Thanks for your amazing tutorial, it helped me a lot, but I think it's better to use a light theme for IDE when you are recording tutorials, it will be much better to read codes. Thanks again.

Dennis Tupas
Guest
Dennis Tupas
4 months 9 days ago

matchDispatchToProps or mapDispatchToProps ??

Allison Graves
Guest
Allison Graves
3 months 8 days ago

Dennis Tupas Dennis Tupas name of the function can be anything, but it's mandatory that you pass it as second argument to connect function after mapStateToProps

Dennis Tupas
Guest
Dennis Tupas
4 months 9 days ago

I tried changing to random function name,its still working though 😀

koftunka
Guest
koftunka
4 months 17 days ago

Shweet, all works so far!

lemelon01
Guest
lemelon01
5 months 6 days ago

Thank you my friend 😉 So cool!

aa aa
Guest
aa aa
5 months 20 days ago

when I add onClick={()=> this.props.selectUser(user)} to <li> ,got error "Cannot read property 'props' of undefined" ?d41d:12 . anyone know why?thanks.

Fedot Serghei
Guest
Fedot Serghei
9 days 14 hours ago

onClick={() => selectUser(user)}

david scully
Guest
david scully
1 month 5 days ago

You need to bind the function createListItems to the UserList component. To do this you can make a constructor for the component and bind the function to the component in it. i.e.class UserList extends Component { constructor(props){ super(props); this.createListItems = this.createListItems.bind(this); } ….<rest of code is the same>Don't really understand it but it got me around this issue. Hope it helps.

Ajay Shrestha
Guest
Ajay Shrestha
1 month 15 days ago

selectUser is a function and not a property so try this onClick={function(){return selectUser(user);}}

aa aa
Guest
aa aa
1 month 16 days ago

It has been a long time, and I'm not sure where the problem is. But for who also has the same problem,you can try onClick={function(){this.props.selectUser(user);}} or onClick={this.props.selectUser(user)}.If it doesn't work, you can search arrow function in ES6 and "js this" and try to solve the problem.

StyleTrick
Guest
StyleTrick
1 month 21 days ago

I'm having the same issue, can't seem to figure it out. Whenever I put the (user) after this.props.selectUser, the error seems to occur…

Gerald Onyango
Guest
Gerald Onyango
2 months 22 days ago

I get this same error. I have no idea how to move past it. anytime I try and use props or post it in console.log i get this error.

Sebastian Serrano Ortiz
Guest
Sebastian Serrano Ortiz
3 months 27 days ago

Hi, how did u fix that error?

aa aa
Guest
aa aa
5 months 20 days ago

ok, I found why. It's about arrow function and 'this'

whiskey 4
Guest
whiskey 4
5 months 30 days ago

you are so fkin awesome! you got me through c++ years back and now redux haahahahahah!

wpDiscuz