November 2018
Beginner
502 pages
10h 22m
English
componentDidMount is invoked when a component has been inserted into the DOM. Here are some common use cases for this method:
We're going to change the app we have been building to give users a time limit of 10 seconds to confirm whether or not they want to learn React and TypeScript. In order to do this, we'll need to make use of the componentDidMount method:
constructor(props: {}) { super(props); this.state = { confirmMessage: "Please hit the confirm button", confirmOpen: false };}
Read now
Unlock full access