Missing native portal implementation for react-native. Teleport views across your component tree for seamless transitions and powerful UI patterns.
npm install react-native-teleport
# or
yarn add react-native-teleport
First of all, you need to add PortalProvider
to your root component - this is usually App.tsx
:
import {PortalProvider} from "react-native-teleport";
export const App = () => (
<PortalProvider>
{/* your app goes here */}
</PortalProvider>
);
Then wrap the content that you want to teleport with Portal
:
import {Portal} from "react-native-teleport";
export const App = () => (
<Portal name="root">
<View style=>
<Text>Hello, world!</Text>
</View>
</Portal>
);
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT