Svelte 101: Component Events [2/2] - Event Forwarding

DOM events bubble. When an event happens on an element, it first runs the handlers on it, then on its parent, then all the way up on other ancestors. Do component event works the same way? Does it run the handler on the component, then on its parent component, then all the way up? You’ll find in the video that, the answer is no. And we are going to take a look how we can recreate the event bubbling behaviour for component events. Introduction 00:00 DOM event bubbling 00:29 Component event forwarding 03:41 DOM event forwarding 08:41 --- 💻 REPL 📚 Related Resources Svelte Svelte REPL Svelte Tutorial: Event forwarding Svelte Tutorial: DOM Event forwarding : Event bubbling and capturing 🥰 Support me
Back to Top