0.1.0 • Published 3 years ago

@innet/portal v0.1.0

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

  @innet/portal

 

NPM minzipped size downloads license

This plugin helps to render a content into separate HTML Element.

Installation

npm

npm i @innet/portal

yarn

yarn add @innet/portal

Or you can include the scripts into the head.

<!-- Dependencies (watchState, innet) -->
<script defer src="https://unpkg.com/watch-state/watch-state.min.js"></script>
<script defer src="https://unpkg.com/innet/innet.min.js"></script>

<!-- Target (innetPortal) -->
<script defer src="https://unpkg.com/@innet/portal/innet-portal.min.js"></script>

Using

Provide the plugin to innet

import innet from 'innet'
import portal from '@innet/portal'
import app from './app'

innet(app, undefined, {portal})

app.tsx

import innet from 'innet'

const div = document.createElement('div')

export default (
  <div>
    test1
    <portal parent={div}>
      test2
    </portal>
  </div>
)

Issues

If you find a bug or have a suggestion, please file an issue on GitHub.
issues


stars watchers