# httptoolkit/react-reverse-portal

React reparenting :atom_symbol: Build an element once, move it anywhere

Repository: https://github.com/httptoolkit/react-reverse-portal
Canonical: https://ross.abutalabs.com/products/react-reverse-portal
Homepage: https://httptoolkit.com
Language: TypeScript
License: Apache-2.0
License Family: permissive
Topics: portal, react, reactjs, reparenting, virtual-dom
Last push: 2026-03-30T12:41:57+00:00

## Health v2 (maintenance only)
Score: 66/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 74, release rhythm 35, longevity 100
- inputs: {"age_days": 2567, "days_push": 156, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1048, forks 41 (observed 2026-08-28T04:03:22.472540+00:00)

## What it is
A tiny React library implementing reverse portals, allowing rendered React elements to be reparented anywhere in the tree without re-rendering. It preserves internal component and DOM state (e.g. a playing video or an initialized editor) while moving elements between locations.

## Use cases
- move a react component elsewhere without losing its state
- reuse an expensive-to-render editor instance in multiple places
- persist a playing video element while relocating it in the dom
- render modals or breadcrumbs declaratively from anywhere in the tree
- pool expensive components and place/unplace them on demand
- detach a react node from the dom and reattach it later without rerendering

## When to choose
- you need to reparent react-rendered DOM nodes while preserving state
- you render costly components once and want to reuse them in different tree locations
- you want a more flexible, declarative alternative to normal portals

## When to avoid
- your components are cheap to render and can simply be re-rendered elsewhere
- you need SSR or non-DOM renderers, which reparenting does not support
- you are not using React

## Facets
- artifact type: library
- maturity: stable
- function: ui-components, state-management
- domain: frontend, web-development
- platform: browser
- tags: react, portal, reparenting, dom, virtual-dom, nodejs

## Member repositories
- httptoolkit/react-reverse-portal (main) score 66

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:22.472540+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:00:43.171972+00:00, confidence not recorded.
  - readme: https://github.com/httptoolkit/react-reverse-portal (fetched 2026-08-28T04:03:22.472540+00:00, sha bdf9c466a4aa)
  - homepage: https://httptoolkit.com (fetched 2026-08-29T13:02:12.445182+00:00, sha 364157b79643)
  - site_page: https://httptoolkit.com/docs (fetched 2026-08-29T13:02:12.456446+00:00, sha 47a264d521ad)
  - registry_npm: https://registry.npmjs.org/react-reverse-portal (fetched 2026-08-29T13:02:12.462680+00:00, sha e36ffad55428)
  - site_page: https://httptoolkit.com/pricing (fetched 2026-08-29T13:02:12.454474+00:00, sha 13a0631a1858)
  - site_page: https://httptoolkit.com/all-integrations (fetched 2026-08-29T13:02:12.458653+00:00, sha 4c43ea947953)
  - site_page: https://httptoolkit.com/download/win-exe (fetched 2026-08-29T13:02:12.460959+00:00, sha f72ae7cf8997)
- Data as of 2026-08-30T08:39:29.467469+00:00.
