Skip to content

Instantly share code, notes, and snippets.

@MrJadaml
Last active November 17, 2016 22:21
Show Gist options
  • Save MrJadaml/d1a37556c07ccca2e6facf48094a946d to your computer and use it in GitHub Desktop.
Save MrJadaml/d1a37556c07ccca2e6facf48094a946d to your computer and use it in GitHub Desktop.

We are describing some scenarios that involve tapping into the component lifecycle:

  • You want to make a request to fetch the user's orders when you are ready to display the orders table (a component).
  • You want to detect when a search field has changed to trigger a new search request.
  • You are filtering a set of cities in the United States based on search in your render method. For performance reasons, you only want to render when the search field has changed.
  • You want to display a new flashcard on the screen but you want to use a CSS transition to make what's currently there fade out.
  • You need to initialize a UI component from a third party (think Materialize, chart.js, d3) once it is loaded.
  • DidMount

  • WillReceiveProps

  • ShouldUpdate

  • WillUpdate

  • DidUpdate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment