@react-lit/portal
TypeScript icon, indicating that this package has built-in type declarations

0.7.0 • Public • Published

@react-lit/portal

Appends a new DOM node to the end of the document.body and renders it's child React tree into it. Useful to break out of the DOM hierarchy to prevent parent styles from clipping or disturbing content (e.g. popovers, dropdowns and modals).

Installation

$ npm i @react-lit/portal
# or
$ yarn add @react-lit/portal

Example

import * as React from 'react';
import { Portal } from "@react-lit/portal";

function Example() {
  return (
    <Portal>
      <div>I'm inside a portal!</div>
    </Portal>
  );
}

Development

(1) Install dependencies

$ npm i
# or
$ yarn

(2) Run initial validation

$ ./Taskfile.sh validate

(3) Run tests in watch-mode to validate functionality.

$ ./Taskfile test -w

This project was set up by @jvdx/core

Readme

Keywords

none

Package Sidebar

Install

npm i @react-lit/portal

Weekly Downloads

0

Version

0.7.0

License

MIT

Unpacked Size

5.6 kB

Total Files

7

Last publish

Collaborators

  • joelvoss