An open API service indexing awesome lists of open source software.

https://github.com/opium-pro/opium-portals

Portals for Rect Native
https://github.com/opium-pro/opium-portals

Last synced: 3 months ago
JSON representation

Portals for Rect Native

Awesome Lists containing this project

README

        

# opium-portals
Portals for Rect Native and React Dom

## 1. Install the package
```
npm i opium-portals
```

## 2. Wrap your app
```jsx
import { PortalsProvider } from 'opium-portals'

const App = () =>
Place your app here.
All portals will be placed right after your app.

```

## 3. Optionally add a wrapper
```jsx
import { PortalsProvider } from 'opium-portals'

// This component will wrap every portal
const Wrapper = ({children}) => children

const App = () =>
Place your app here.
All portals will be placed right after your app.

```

## 4. Use portal component
```jsx
import { Portal } from 'opium-portals'

const MyComponent = () =>
Your code here

```

## 5. Or use HOC
```jsx
import { withPortal } from 'opium-portals'

const MyComponent = withPortal(() => 'Your code here')
```

to call your component inside the portal, use `inPortal` prop

```jsx

```