From 5e782cd6f971abbfefff89aad6aca1c199e78b80 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 26 Sep 2017 22:23:20 +0100 Subject: [PATCH] Minor doc edit --- docs/portals.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/portals.md b/docs/portals.md index 25b28ee8..a0bbdc48 100644 --- a/docs/portals.md +++ b/docs/portals.md @@ -48,7 +48,7 @@ A typical use case for portals is when a parent component has an `overflow: hidd [Try it on CodePen.](https://codepen.io/gaearon/pen/yzMaBd) -## Portals and event bubbling +## Event Bubbling Through Portals Even though a portal can be anywhere in the DOM tree, it behaves like a normal React child in every other way. Features like context work exactly the same regardless of whether the child is a portal, as the portal still exists in the *React tree* regardless of position in the *DOM tree*. @@ -139,6 +139,6 @@ function Child() { ReactDOM.render(, appRoot); ``` -[Try it on CodePen.](https://codepen.io/gaearon/pen/jGBWpE). +[Try it on CodePen.](https://codepen.io/gaearon/pen/jGBWpE) Catching an event bubbling up from a portal in a parent component allows the development of more flexible abstractions that are not inherently reliant on portals. For example, if you render a `` component, the parent can capture its events regardless of whether it's implemented using portals.