An open API service indexing awesome lists of open source software.

https://github.com/hamlim/react-portal

A simple portal component for React 16+
https://github.com/hamlim/react-portal

portal react react16

Last synced: about 1 month ago
JSON representation

A simple portal component for React 16+

Awesome Lists containing this project

README

          

# React-Warp 🌀

A dead simple component to handle rendering portals.

Simply pass in your children and provide an `isOpen` prop:

```JSX



The 🍰 is a lie!




```

### Under the Hood:

This uses React 16's `createPortal`, it also has an additional hook to allow implementers to provider their own factory function for determining where to mount the portal.

### API:

* `` props:
* `isOpen`: boolean determines if the portal is rendering the children or null
* `provideMountPoint`: function a function to return the portal mount point, defaults to creating a div and appending it to the bottom of the body