
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
- 1Build a modal component using `createPortal` into a `#modal-root` div.
- 2Notice that events still bubble through the React tree, not the DOM tree.
- 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.