react-native-platform-visible

0.0.1 • Public • Published

React Native Platform Visible

A visibility switch based on Platform that enables code like this:

<PlatformVisible.iOS>
  <Text>See me on iOS</Text>
</PlatformVisible.iOS>
<PlatformVisible.Android>
  <Text>See me on Android</Text>
</PlatformVisible.Android>

Installation

npm install react-native-platform-visible --save

Usage

import PlatformVisible from 'react-native-platform-visible';

Or

var PlatformVisible = require('react-native-platform-visible');

And then either:

<PlatformVisible target="ios">
  <Text>Shown on iOS</Text>
</PlatformVisible>

Or the more friendly:

<PlatformVisible.iOS>
  <Text>See me on iOS</Text>
</PlatformVisible.iOS>

/react-native-platform-visible/

    Package Sidebar

    Install

    npm i react-native-platform-visible

    Weekly Downloads

    1

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • jdherrington