Package Exports
- react-native-portals
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-portals) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
⚛️ react-native-portals
🚀 Install
run
yarn add react-native-portals
or
npm i react-native-portals --save
🪄 Usage
// 1. Create your portal
import { createPortal } from 'react-native-portals';
export const GlobalPortal = createPortal();
// 2. Place the Host inside any component
<GlobalPortal.Host/>
// 3. Just insert your component inside the Site and it will move to the Host
<GlobalPortal.Site>
<Text>Aloha World!</Text>
</GlobalPortal.Site>