react-minimalist-portal
A minimalist portal for react. Create a new React tree in document.body to create modal etc .. This package is compatible with react 15 and 16.
Usage
;; Component { return <Portal> <p>I am in document body</p> </Portal> ; } // If you want to render the portal inside your own containerconst container = document; Component { return <Portal container=container> <p>I am in my-custom-container-id</p> </Portal> ; }
Props
container
- optional - You can specify a container prop which should be ofElement
type. The portal will be rendered inside that element. The default behavior will create a div node and render it at the at the end ofdocument.body
.