Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-polyfill-portal

kingback28MIT1.1.0

React createPortal polyfill

React, portal, createPortal, polyfill

readme

react-polyfill-portal

Polyfill for React new portal api

Support

>= react@0.14.9

Usage

import { createPortal } from 'react-polyfill-portal';

function Portal() {
  return createPortal(props.children, document.body);
}

function App() {
  return (
    <div>
      <Portal>
        <p>text</p>
      </Portal>
    </div>
  );
}

For more usage, see https://reactjs.org/docs/portals.html