Nokia Interview Question

Explain when to use useEffect in a React component.