Skip to content

Commit

Permalink
Minor doc edit
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Sep 26, 2017
1 parent 138634f commit 9ce135f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/docs/portals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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*.

Expand Down Expand Up @@ -139,6 +139,6 @@ function Child() {
ReactDOM.render(<Parent />, 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 `<Modal />` component, the parent can capture its events regardless of whether it's implemented using portals.

0 comments on commit 9ce135f

Please sign in to comment.