---
source: https://iinventedlight.com/library/notes/react-portals.md
title: "React createPortal: render children into another DOM node"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (React docs); CC-BY-4.0 (reactjs/react.dev); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: React docs, createPortal; reactjs/react.dev, createPortal.md. CC-BY-4.0 (https://raw.githubusercontent.com/reactjs/react.dev/main/LICENSE-DOCS.md). Copyright Meta Platforms, Inc. and affiliates."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: react createPortal"
tags: [react, portals, createPortal, react-dom, dom]
client: Librarian
sources:
  - id: S1
    title: "createPortal"
    publisher: React docs
    url: https://react.dev/reference/react-dom/createPortal
    accessed: 2026-11-18
    license: "CC-BY-4.0"
  - id: S2
    title: "createPortal.md"
    publisher: reactjs/react.dev
    url: https://github.com/reactjs/react.dev/blob/main/src/content/reference/react-dom/createPortal.md
    accessed: 2026-11-18
    license: "CC-BY-4.0"
---
# React createPortal: render children into another DOM node
**Answer:** createPortal lets you render some children into a different part of the DOM. Import createPortal from react-dom. A portal only changes the physical placement of the DOM node. Events bubble up from children to parents according to the React tree.

## Examples

```js
import { createPortal } from 'react-dom';

export function Dialog({ children }) {
  return createPortal(children, document.body);
}
```

## Notes

 Context is still provided by the parent tree. Portals are useful for a modal dialog or for rendering into document.body.

## Reference list

- `createPortal` renders children into a different part of the DOM.
- `Import` createPortal from react-dom.
- `Events` bubble according to the React tree, not only the DOM tree.

## See also

- [react-refs](https://iinventedlight.com/library/notes/react-refs/)
- [react-components-basics](https://iinventedlight.com/library/notes/react-components-basics/)
- [react-context](https://iinventedlight.com/library/notes/react-context/)

## Claims

- id: C1
  claim: createPortal renders children into a different part of the DOM.
  source: S1
  evidence: "lets you render some children into a different part of the DOM"

- id: C2
  claim: Import createPortal from react-dom.
  source: S2
  evidence: "import { createPortal } from 'react-dom'"

- id: C3
  claim: Events bubble according to the React tree, not only the DOM tree.
  source: S2
  evidence: "events bubble up from children to parents according to the React tree"

## Sources

- [S1] createPortal. React docs. https://react.dev/reference/react-dom/createPortal . License: CC-BY-4.0. Accessed 2026-11-18.

- [S2] createPortal.md. reactjs/react.dev. https://github.com/reactjs/react.dev/blob/main/src/content/reference/react-dom/createPortal.md . License: CC-BY-4.0. Accessed 2026-11-18.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: React docs, createPortal; reactjs/react.dev, createPortal.md. CC-BY-4.0 (https://raw.githubusercontent.com/reactjs/react.dev/main/LICENSE-DOCS.md). Copyright Meta Platforms, Inc. and affiliates. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
