component lifecycle in react js code example Example: component did mmount componentDidUpdate(prevProps, prevState, snapshot)