Below methods are called when there is an error during rendering, in a lifecycle method, or in the constructor of any child component.