portalo

react portal

Usage no npm install needed!

<script type="module">
  import portalo from 'https://cdn.skypack.dev/portalo';
</script>

README

What is react portal ?

Consider a case you want to attach a child component someplace other than current component.

Installation

npm i react-provided-portal

Interface

<Portal
  selector="test-container"
  didMount={parent => console.log('component mounted!')}
  willUnmount={() => console.log('component unmounted!')}
>
  <div>hello-world</div>
</Portal>

Examples

const TestComponent