Created
May 31, 2021 06:21
-
-
Save tomedme/8928ce7d1998eefc82ae93d354afe608 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In case you're interested by making you're constructor more dry you could also use the ES6 fat arrow syntax. | |
constructor(props) { | |
super(props); | |
} | |
handleScroll = (event) => { | |
console.log('the scroll things', event) | |
}; | |
Fat arrow automatically bind this to the method, allowing shorter constructor. Especially when you have a lot of methods. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment