how to use react component lifecycle code example Example: component did mmount componentDidUpdate(prevProps, prevState, snapshot)