react-native/docs
Mike Grabowski edf8888fb9 Platform.select method
Summary:
Kudos to frantic for this amazing idea! Works really well (yet so simple!)

Basically we had a discussion with vjeux and frantic and others in the PR #7033 how to handle platform-specific stylesheets in a similar to F8 app way.

There were quite a few nice ideas there, however that one seems to be the smallest yet the most powerful.

Basically there's a `Platform.select` method that given an object, will select a `obj[Platform.OS]` value.

It works with styles:
`Platform.select({ ios: {}, android: {} })`

with messages:
`<Text>{Platform.select({ ios: 'Check the App Store', android: 'Check Google Play' })}</Text>`

and also works well with components (similar to Wallmart idea of <PlatformSwitch />) - relevant example included in diff.
Closes https://github.com/facebook/react-native/pull/7220

Differential Revision: D3221709

Pulled By: vjeux

fb-gh-sync-id: 0a50071f2dcf2273198bc6e2c36e19bca97d7be9
fbshipit-source-id: 0a50071f2dcf2273198bc6e2c36e19bca97d7be9
2016-04-25 16:32:20 -07:00
..
Accessibility.md React.findNodeHandle -> ReactNative.findNodeHandle 2016-04-07 19:44:31 -07:00
AndroidBuildingFromSource.md Add download links for Android NDK to the docs 2016-03-26 10:44:18 -07:00
AndroidUIPerformance.md CI now builds docs website and deploys it to /%version% path 2016-02-11 06:17:42 -08:00
Animations.md Use es6 in animation examples 2016-04-06 09:23:20 -07:00
Colors.md Add support for number as colors 2016-02-08 04:04:38 -08:00
CommunicationIOS.md fix es6 class method 2016-02-15 14:55:36 -08:00
Debugging.md Update Debugging.md 2016-04-22 10:54:21 -07:00
DevelopmentSetupAndroid.md Update DevelopmentSetupAndroid.md 2016-04-12 09:43:19 -07:00
DirectManipulation.md Fix broken link for shouldComponentUpdate 2016-04-12 19:50:20 -07:00
EmbeddedAppAndroid.md Update EmbeddedAppAndroid.md 2016-03-24 07:11:30 -07:00
EmbeddedAppIOS.md CHORE - Remove Trailing Spaces 2016-04-06 09:21:53 -07:00
GestureResponderSystem.md CI now builds docs website and deploys it to /%version% path 2016-02-11 06:17:42 -08:00
GettingStarted.md Update GettingStarted.md 2016-04-11 11:35:24 -07:00
GettingStartedOnLinux.md Update GettingStartedOnLinux.md 2016-04-10 14:54:21 -07:00
Images.md Add note about adding new images 2016-03-06 02:07:23 -08:00
IssueGuidelines.md CHORE - Remove Trailing Spaces 2016-04-06 09:21:53 -07:00
JavaScriptEnvironment.md CHORE - Remove Trailing Spaces 2016-04-06 09:21:53 -07:00
KnownIssues.md Android Slider is now open sourced 2016-04-07 07:29:28 -07:00
LinkingLibraries.md CI now builds docs website and deploys it to /%version% path 2016-02-11 06:17:42 -08:00
LinuxWindowsSupport.md CHORE - Remove Trailing Spaces 2016-04-06 09:21:53 -07:00
MoviesExample.json Fix typo and add comments to the example app 2015-03-27 20:44:20 +00:00
NativeComponentsAndroid.md Fix broken link 2016-03-02 04:36:33 -08:00
NativeComponentsIOS.md Added a small note about an issue I ran into vending a simple `UIView? 2016-04-04 04:36:19 -07:00
NativeModulesAndroid.md Improve Android native module doc 2016-04-01 10:08:19 -07:00
NativeModulesIOS.md Added objective-c class/module semantics 2016-03-08 07:07:27 -08:00
NavigatorComparison.md Update NavigatorComparison.md 2016-04-10 11:51:18 -07:00
Network.md Add support for ontimeout and onerror handler when using XMLHttpRequest for Android and iOS 2016-04-15 05:17:21 -07:00
Newsletter.md Introduce blog 2016-03-24 14:11:30 -07:00
Performance.md LayoutAnimation now works on android 2016-03-06 09:22:25 -08:00
PixelRatio.md Move around the docs a bit 2015-03-25 11:52:29 -07:00
PlatformSpecificInformation.md Platform.select method 2016-04-25 16:32:20 -07:00
PullRequestGuidelines.md Tweak commands and guidelines 2016-03-20 13:14:25 -07:00
RunningOnDeviceAndroid.md Adds alternative method of opening the dev menu using `adb shell input keyevent 82` 2016-01-06 21:28:16 -05:00
RunningOnDeviceIOS.md CI now builds docs website and deploys it to /%version% path 2016-02-11 06:17:42 -08:00
SignedAPKAndroid.md Option to not store credentials in file 2016-04-21 04:08:23 -07:00
Style.md CI now builds docs website and deploys it to /%version% path 2016-02-11 06:17:42 -08:00
Testing.md Fix typo in Testing.md 2015-12-11 15:22:57 +01:00
Text.md CHORE - Remove Trailing Spaces 2016-04-06 09:21:53 -07:00
Timers.md Add timer usage for es6 2016-03-26 05:42:26 -07:00
Troubleshooting.md Fixes a minor typo in docs/Troubleshooting.md 2016-04-17 20:42:21 -07:00
Tutorial.md Removing Rotten Tomatoes API Info 2016-04-17 20:56:23 -07:00
Upgrading.md CI now builds docs website and deploys it to /%version% path 2016-02-11 06:17:42 -08:00
Videos.md Introduce blog 2016-03-24 14:11:30 -07:00