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

0.0.5 • Public • Published

lmnl portal

Portal allows you to define components as you normally would, and output them to an <Outlet /> somewhere else in your app e.g. rendering a modal at the root.

// Root.tsx
import { Provider, Outlet } from '@lmnl/portal'

export function Root() {
  return (
    <View>
      <App />

      <Outlet />
    </View>
  )
}
// components/Component.tsx
import { Portal } from '@lmnl/portal'

export function Component() {
  return (
    <View>
      <Text>My nested component</Text>

      <Portal>
        {/* Renders to <Outlet /> on mount */}
        <PortaledComponent />
      </Porta>
    </View>
  )
}

Readme

Keywords

none

Package Sidebar

Install

npm i @lmnl/portal

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

10.8 kB

Total Files

10

Last publish

Collaborators

  • estrattonbailey