🔥 3-day streak
Microsoft Power Platform Developer84 / 140
Question 84 of 140
You built a PCF field component that, in its init method, subscribes to a browser resize event using window.addEventListener and starts a setInterval timer to poll an external service. Testers report that after navigating between records on a model-driven form many times, the browser tab consumes increasing amounts of memory and multiple timers fire simultaneously. In which lifecycle method should you remove the event listener and clear the interval to fix this?
Reviewed for accuracy · Report an issueNext question