which method is to be used when there is an error in lifecycle method in react js code example Example: component did mmount componentDidMount()