portal-storm
v1.0.2
Published
A simple wrapper component for React portals.
Downloads
3
Maintainers
Readme
Portal Storm
A simple wrapper component for React portals.
Installation
Run yarn add portal-storm
or npm i portal-storm
.
Usage
Note: Both the container
and the children
props are required.
import React from 'react';
import Portal from 'portal-storm';
import logo from './assets/images/logo.png';
export default function App() {
return (
<div className="App">
<Portal container={document.head}>
<link rel="preload" as="image" href={logo} type="image/png" />
</Portal>
<img className="App__logo" src={logo} alt="logo" />
</div>
);
}