Capture, target and bubble phases
Comes up in: Web fundamentals, JavaScript, Recruiter screen
This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.
What it covers
- the three phases
addEventListeneroptions (capture,once,passive,signal)stopPropagationvsstopImmediatePropagationvspreventDefault- events that do not bubble (focus/blur vs focusin/focusout)
composedPath
Words you will know
What you will practise
- predict handler order in nested elements
Interview questions this answers
- Explain event bubbling and capturing.
- What is the difference between
stopPropagationandpreventDefault? - Which events do not bubble?
- How does React handle events under the hood?