Module Platform-BsReactNative
type iosIdiom
=
;|
Phone
|
Pad
|
TV
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.
You can read more on
Platform
API usage in official docs: https://facebook.github.io/react-native/docs/platform-specific-codeExample of use
marginTop(Pt(Platform.os() == Platform.Android ? 20.0 : 0.0))
type os
=
;|
IOS(iosIdiom)
|
Android
let os: unit => os;
Raises UnknownPlatform for non-standard platforms such as "web" from react-native-web
let equals: os => bool;
let select: selectOptions('a) => 'a;