-
-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathPlatform.res
More file actions
27 lines (21 loc) · 686 Bytes
/
Platform.res
File metadata and controls
27 lines (21 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
type os = [#ios | #android | #macos | #windows | #web]
/** Do not switch on `Platform.os`, as it will result in code
that prevents the Metro bundler from inlining. Instead, use an if
or ternary expression.
```rescript
Platform.os === #ios
? doSomethingInIos()
: doSomethingInOtherPlatform()
```
*/
@module("react-native")
@scope("Platform")
external os: os = "OS"
@module("react-native") @scope("Platform")
external isPad: bool = "isPad"
@module("react-native") @scope("Platform")
external isTV: bool = "isTV"
@module("react-native") @scope("Platform")
external isVision: bool = "isVision"
@module("react-native") @scope("Platform")
external isTesting: bool = "isTesting"