Stop 08 · ReactTopics · 16/20

Portals

Part of the Frontend Developer Roadmap

In short

`createPortal` renders a component's children into a DOM node outside its parent hierarchy — the standard way to build modals, tooltips and dropdowns that need to escape overflow/z-index constraints.

How to learn this

  1. 1Build a modal component using `createPortal` into a `#modal-root` div.
  2. 2Notice that events still bubble through the React tree, not the DOM tree.
  3. 3Compare a portal-based modal to one nested normally to see the z-index/overflow issues it solves.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge