Skip to main content

Portal

Portal allows rendering a component at a different place in the parent tree. You can use it to render content which should appear above other elements, similar to Modal. It requires a Portal.Host component to be rendered somewhere in the parent tree. Note that if you're using the Provider component, this already includes a Portal.Host.

Usage

import * as React from 'react';
import { Portal, Text } from 'react-native-paper';

const MyComponent = () => (
<Portal>
<Text>This is rendered at a different place</Text>
</Portal>
);

export default MyComponent;

Props

children (required)

Type: React.ReactNode

Content of the Portal.

theme (required)

Type: InternalTheme

More Examples

Toggle to grab more examples