react set state in component will mount code example Example: component did mmount componentDidUpdate(prevProps, prevState, snapshot)