 Hello everyone. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this module, I'm going to discuss about event propagation that is available in lightning or a component development. So let's start and understand event propagation. So the framework basically supports capture and bubble phases for the propagation of component and application events. These phases provide an opportunity for interested components to interact with an event and potentially control the behavior for subsequent handler. Right. So these are two phases. Those are available for this event propagation, capture and bubble. So the component that fires an event is known as the source component. The framework allows you to handle the event in different phases. These phases give you flexibility for how to best process the event for your application. So let's talk about capture phase first. The event is captured and trickles down from the application route to the source component. The event can be handled by a component in the containment hierarchy that receives the capture event, right? So it goes from top to down. So event handlers are invoked in order from the application route down to the source component that fired the event, right? So if you use capture phase, so this thing happens in the containment hierarchy. Now, second is bubble phase. So the component that fired the event can handle it. The event then bubbles up from the source component to the application route, right? So here, like, event will go from bottom to up. So the event can be handled by a component in the containment hierarchy that receives the bubble, bubbled event. So let's say lower most component fired an event. So the component which is above in the hierarchy, the parent component that can handle that event. So because that event will be bubbled from that child to parent component. So event handlers are invoked in order from the source component that fired the event up to the application route. So it goes from bottom to top, whereas in capture phase it goes from top to bottom. So sequence of component event propagation. So if we have capture phase, the framework executes the capture phase from the application route to the source component until all components are traversed or stop propagation is called. So this is a method to stop the event propagation in middle. Next is bubble phase. The framework executes the bubble phase from the source component to the application route until all components are traversed or stop propagation is called. Right. So now you need to understand that component event works in the parent child hierarchy only. So if you use capture phase, so it goes to the application route and then it will traverse from bottom to sorry top to bottom. The bubble phase it will go from bottom to up. Now if I talk about sequence of application event so both things will be same. The difference is in case of application event like it can be handled by any component that is available in the application. So it works as a spectrum of the component hierarchy like it goes beyond the parent child hierarchy as well. So you can see like capture event sorry capture phase is the framework executes a capture phase from the application route to the source component until all components are traversed or stop propagation is called. And in bubble phase the framework executes all bubble phase from the source component to the application route until all components are traversed or stop propagation is called. The application event propagation we have default phase as well. So the framework executes the default phase from the root node, unless prevent default was called in the capture or bubble phase. If the event's propagation wasn't stopped in a previous phase the root node defaults to the application route. The event's propagation was stopped in a previous phase the root node is set to the component whose handler invoked event stop propagation. Right, so this is brief about even propagation that is available in lightning or a component so we have two phases bubble and capture. So accordingly you can use. Thank you.