Skip to content

v1.0.0

Compare
Choose a tag to compare
@cheton cheton released this 27 Dec 08:52
· 4 commits to master since this release
83086b7

This release contains a breaking change, it will no longer wrap children with a div.

Portal v1.0.0 enables support for using ReactDOM.createPortal() with React v16. A legacy fallback is provided for backward compatibility with React v15.

Portal

<Portal>
    This text is transported to the end of document.body.
</Portal>

<Portal node={document.body && document.body.querySelector('#modal-container')}>
    This text is transported to a DOM element.
</Portal>

LegacyPortal

Use LegacyPortal if you need cross-frame rendering support.

<LegacyPortal
    node={window.top.document && window.top.document.querySelector('#modal-container')}
>
    This text is transported to a DOM element within the top window document.
</LegacyPortal>