HCLTech interview question

How to handle any logic while un-mounting React component