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+
- Host: GitHub
- URL: https://github.com/hamlim/react-portal
- Owner: hamlim
- Created: 2017-08-12T00:30:02.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2026-04-12T15:46:34.000Z (about 2 months ago)
- Last Synced: 2026-04-12T17:30:51.212Z (about 2 months ago)
- Topics: portal, react, react16
- Language: JavaScript
- Size: 992 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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