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
- [ReactNative] Open Source PushNotifications and move Badge Number methods and permission into it | Tadeu Zagallo
- [react-packager] Fix regression with transform errors | Amjad Masad
- Flowify TextStylePropTypes and fix a bug with unsupported props | Marshall Roch
- [ReactNative] Remove `arc build` instructions from require | Alex Kotliarskyi
- Flowify Library/Utilities/ | Marshall Roch
- [react-packager] Default to index.js from main if it's a dir | Amjad Masad
- [ReactNative] Use deprecated ix in TabBarExample | Amjad Masad
- [ReactNative] Expanded license on obj-c files | Christopher Chedeau
- [ReactNative] Expanded license on js files | Christopher Chedeau
- [ReactNative] Fix React Devtools integration | Alex Kotliarskyi
- [Text] Account for font leading so descenders are not clipped | James Ide
- [ReactNative] Expanded license on js packager files | Christopher Chedeau
- more UIExplorer flow | Basil Hosmer
- [react-packager] Pick up package changes while running | Amjad Masad
- Added a graph view and a ReactNative metric that displays current queue and execution time for the JS thread. | Bryce Redd
- [ReactNative] Add NativeModules and DeviceEventEmitter to react-native exports | Alex Kotliarskyi