1.0.5 • Published 3 years ago

@suinegmai/react-teleport v1.0.5

Weekly downloads
7
License
MIT
Repository
-
Last release
3 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

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

0.0.5

4 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago