React TL;DR โ€“ a human filter for most useful React content.

All posts

react-cool-portal

This is a React hook for Portals. It helps you render children into a DOM node that exists outside the DOM hierarchy of the parent component.

Features:

  • ๐Ÿ’ Renders an element or component to <body> or a specified DOM element.
  • ๐ŸŽฃ React Portals feat. Hook.
  • ๐Ÿค– Built-in state controllers, event listeners and many useful features for a comprehensive DX.
  • ๐Ÿงฑ Used as a scaffold to build your customized hook.
  • ๐Ÿงน Auto remove un-used portal container for you. Doesn’t produce any DOM mess.
  • ๐Ÿ“œ Support TypeScript type definition.
  • ๐Ÿ—„๏ธ Server-side rendering compatibility.
  • ๐Ÿฆ  Tiny size (~ 1.4KB gzipped). No external dependencies, aside for the react and react-dom.