Q40: How does Event Bubbling work through React Portals?
Even though a portal renders into an external DOM node, events fired inside a portal bubble up through the React virtual component tree hierarchy, NOT the real physical DOM tree hierarchy.
Key Takeaways
- Events bubble according to the React Virtual DOM component tree, not physical DOM nodes.
- Parent React components can capture events emitted by portaled children components.
Knowledge Check
If a button inside a Portal triggers a click, which component catches the event as it bubbles up?