React Teleporter
JSON →React Teleporter is a library designed for seamlessly moving or "teleporting" React components within the same React component tree. Unlike standard React Portals, which can render children into a different DOM node outside the current DOM hierarchy, `react-teleporter` maintains the logical connection within the same React tree. This distinction simplifies state and context management, as components remain within their original React context, making it ideal for managing complex layouts where content needs to appear in a different visual location than where it's defined. Inspired by the configuration philosophy of `react-helmet`, it allows for configuring parts of an application from a separate, perhaps deeply nested, location. The current stable version is 3.2.0, with regular minor and patch releases to support new React versions (currently up to React 19) and add features like `function as children` for `Source` components. Major versions, such as v3.0.0, introduce significant breaking changes, notably the transition to an ESM-only distribution. The library exports `createTeleporter`, which generates a `Source` and `Target` pair, enabling content defined within a `Source` component to be rendered at the `Target`'s designated position.
Traffic · last 30 days ↑0% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany