Svelte · Senior · Question 11 of 75
How does Svelte 5 handle events like click and input for performance?
- ✓Correct answer: It uses event delegation: one listener at the application root dispatches to the handlers of the target elements
- 2It adds a listener to each element and removes it after each event
- 3It polls the DOM
Explanation
This matters when mixing with manually added listeners: stopPropagation in a native listener on an ancestor can stop delegated handlers from firing.