r/reactjs • u/swyx • Jun 03 '18
Beginner's Thread / Easy Question (June 2018)
Hello! just helping out /u/acemarke to post a beginner's thread for June! we had over 270 comments in last month's thread! If you didn't get a response there, please ask again here! You are guaranteed a response here!
Soo... Got questions about React or anything else in its ecosystem? Stuck making progress on your app? Ask away! We’re a friendly bunch. No question is too simple.
The Reactiflux chat channels on Discord are another great place to ask for help as well.
Pre-empting the most common question: how to get started learning react?
You might want to look through /u/acemarke's suggested resources for learning React and his React/Redux links list. Also check out http://kcd.im/beginner-react.
View all comments
Show parent comment
1
u/seands Jun 08 '18 edited Jun 08 '18
I did some testing using a simple method to fire a window alert. It fired upon instantiation of the component class. Looks like the arrow function rebinds the function to the method instead, which is what we intend. So that's the answer. I learned that here by the way: https://www.youtube.com/watch?v=xa-_FIy2NgE
PS: binding in the constructor forgoes the need to bind within the render method and makes the app only need to create the function once.