From e32d51632e95f49aa24c3c45672bdae3bf18036d Mon Sep 17 00:00:00 2001 From: Website Deployment Script Date: Mon, 8 Aug 2016 18:24:39 +0000 Subject: [PATCH] Updated docs for next --- releases/next/docs/platform-specific-code.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releases/next/docs/platform-specific-code.html b/releases/next/docs/platform-specific-code.html index b304fdc1ac7..af9c3605ced 100644 --- a/releases/next/docs/platform-specific-code.html +++ b/releases/next/docs/platform-specific-code.html @@ -1,4 +1,4 @@ -Platform Specific Code – React Native | A framework for building native apps using React

Platform Specific Code #

When building a cross-platform app, you'll want to re-use as much code as possible. Scenarios may arise where it makes sense for the code to be different, for example you may want to implement separate visual components for iOS and Android.

React Native provides two ways to easily organize your code and separate it by platform:

Certain components may have properties that work on one platform only. All of these props are annotated with @platform and have a small badge next to them on the website.

Platform module #

React Native provides a module that detects the platform in which the app is running. You can use the detection logic to implement platform-specific code. Use this option when only small parts of a component are platform-specific.

import { Platform, StyleSheet } from 'react-native'; +Platform Specific Code – React Native | A framework for building native apps using React

Platform Specific Code #

When building a cross-platform app, you'll want to re-use as much code as possible. Scenarios may arise where it makes sense for the code to be different, for example you may want to implement separate visual components for iOS and Android.

React Native provides two ways to easily organize your code and separate it by platform:

Certain components may have properties that work on one platform only. All of these props are annotated with @platform and have a small badge next to them on the website.

Platform module #

React Native provides a module that detects the platform in which the app is running. You can use the detection logic to implement platform-specific code. Use this option when only small parts of a component are platform-specific.

import { Platform, StyleSheet } from 'react-native'; const styles = StyleSheet.create({ height: (Platform.OS === 'ios') ? 200 : 100,