1.0.5 • Published 4 years ago

@suinegmai/react-teleport v1.0.5

Weekly downloads
7
License
MIT
Repository
-
Last release
4 years ago

react-teleport

Simple React portal

npm version

Installation

npm i @suinegmai/react-teleport

or

yarn @suinegmai/react-teleport

Usage

import { createPortal } from '@suinegmai/react-teleport'

const Portal = createPortal()

function App() {
  return (
    <div>
      <Portal.Target />
      <div>
        Somewhere
        <div>
          deep
          <div>
            in
            <div>
              the
              <div>
                tree
                <Portal.Source>
                  <p>This will be rendered to Portal.Target node</p>
                </Portal.Source>
              </div>
              <Portal.Source>
                <p>Multiple sources can be rendered to a single target</p>
              </Portal.Source>
            </div>
          </div>
        </div>
      </div>
    </div>
  )
}
1.0.5

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

0.0.5

5 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago