Cognizant interview question

How componentWillUnmount works in React Application?