@shevsky/via-portal
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Wrap components to portal

Example

import { viaPortal } from '@shevsky/via-portal';
import React, { PropsWithChildren } from 'react';

type TFooProps = PropsWithChildren<{}>;

export const Foo = viaPortal((props: TFooProps): JSX.Element => {
  return (
    <div className="foo">
      {props.children}
    </div>
  );
}, 'foo'); // Would be rendered to <div data-foo-portal/> at the end of <body/>

Readme

Keywords

none

Package Sidebar

Install

npm i @shevsky/via-portal

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

4.24 kB

Total Files

11

Last publish

Collaborators

  • shevsky