Skip to content

burstware/react-native-portal

Repository files navigation

React Native Portal

NPM Slack

Render a component anywhere. Anything inside a <Portal> component will be rendered on an ancestor <Portal.Host> component.

See Demo

Installation

npm i --save @burstware/react-native-portal

Usage

import React from 'react'
import { Text, View } from 'react-native'
import Portal from '@burstware/react-native-portal'

export default function (props) {
  return (
    <Portal.Host>
      <View>
          <Text>Background Text</Text>
          <Portal>
            <View style={styles.smallParent}>
              <Text>portal parent view</Text>
                <View>
                  <Text>This should be on top</Text>
                </View>
            </Portal>
          </View>
      </View>
    </Portal.Host>
  )
}

Based on Portal implementation in React Native Paper

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published