Skip to content

Instantly share code, notes, and snippets.

@tomedme
Created May 31, 2021 06:21
Show Gist options
  • Select an option

  • Save tomedme/8928ce7d1998eefc82ae93d354afe608 to your computer and use it in GitHub Desktop.

Select an option

Save tomedme/8928ce7d1998eefc82ae93d354afe608 to your computer and use it in GitHub Desktop.
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