React Cheatsheet

componentDidMount()

  • Called at the end of every render()
  • A good place to load in data, and call setState() to re-render the page with the new information

arrowFunction = ( ) =>”hello”

  • Not necessarily a React ONLY component, because it is used across all of js. Since there are a lot of component inside component code, and calling other functions, I have seen it a lot within React.
  • the purpose of the arrow is to ensure that the correct “this” is being called
  • The object of where the function was being called will be referred to as “this”, rather than the potential of returning null if not bound correctly with “bind”.
  • arrow function could cause slower rendering because a new function needs to be created

Some Good Resources:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store