0.1.12 • Published 3 years ago

@personio/utils-portal-manager v0.1.12

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

@personio/utils-portal-manager

Installation

yarn add @personio/utils-portal-manager

PortalManager.containerInstance()

This function creates, or if it exists, returns the global portals container DOM element.

import { PortalManager } from '@personio/utils-portal-manager';

// Creates a new DOM element
const newPortalsContainer = PortalManager.containerInstance();

// Returns the existing DOM element
const existingPortalsContainer = PortalManager.containerInstance();

console.log(newPortalsContainer == existingPortalsContainer); // => true

GroupedPortal

React component that appends a portal to the global portals container.

import { GroupedPortal } from '@personio/utils-portal-manager';

const MyComponent = () => {
  return (
    <GroupedPortal>
      This content is rendered in the global portals container.
    </GroupedPortal>
  );
};
0.1.12

3 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago