portal-storm
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Portal Storm

GitHub npm version Tests codecov

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>
  );
}

Package Sidebar

Install

npm i portal-storm

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

5 kB

Total Files

9

Last publish

Collaborators

  • synthetic.borealis