The React component has many life cycle methods that you can override. These methods are executed at certain phases of the component's life cycle. The names of the life cycle methods are logical and you can almost guess when they are going to be executed—the life cycle methods that have a will prefix are executed before an action is performed, and the methods with a did prefix are executed right after an action is performed.
Mounting is one phase of the component life cycle. It is the moment when the component is created and inserted into the DOM. Two life cycle methods that we have already covered are executed when the component mounts constructor() and render().
A useful method in the mounting phase is componentDidMount(), which is called after the component has been mounted. This method is suitable for calling some REST APIs to get data...