class component lifecycle methods react code example Example: component did mmount componentDidMount()