Skip to content

Instantly share code, notes, and snippets.

@MarchCorbin
Created July 2, 2020 00:53
Show Gist options
  • Save MarchCorbin/a3dcab40ef9dfde62bbdd3a95f960ae1 to your computer and use it in GitHub Desktop.
Save MarchCorbin/a3dcab40ef9dfde62bbdd3a95f960ae1 to your computer and use it in GitHub Desktop.
Turing Homework the lifecycle

Mounting Phase

Constructor()

  • The constructor is used to set a template or a class for future iterations of the same class or using the state attribute to store and use data. This is read during the mounting phase.

render()

  • render is used to display visual data to the dom. It is initially read during the mounting phase or at page load but it also is read whenever there is an update or change during the updating phase.

componentDidMount()

  • This is the starting data. Most fetch calls will be made within this function and it is read at page load during the mounting phase.

Updating Phase

render()

  • render is read to change anything related to the dom in the case that a change is made during the updating phase.

componentDidUpdate()

  • This function is called immediately upon an update on the dom. It is not fired during page load it is used during the updating phase.

Unmounting Phase

componentWillUnmount()

  • This function is invoked whenever a component is removed from the DOM. This function exclusively exists in the unmounting phase.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment