React Developer — Medium
Key points
- The cleanup function ensures that resources are properly cleaned up
- It runs before the next effect execution or component unmount
- Helps prevent memory leaks by removing unnecessary subscriptions or listeners
Ready to go further?
Related questions
