A very simple component visibility switch based on Platform
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Latest commit aaa8204 Sep 18, 2015
Permalink
Failed to load latest commit information.
.gitignore First commit Sep 18, 2015
LICENSE.txt Updating license Sep 18, 2015
README.md First commit Sep 18, 2015
index.js First commit Sep 18, 2015
package.json Updating license Sep 18, 2015

README.md

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>