|
6 | 6 | */ |
7 | 7 | open ReactNative; |
8 | 8 |
|
9 | | -let instructions = |
10 | | - switch (Platform.os) { |
11 | | - | os when os == Platform.ios => |
12 | | - "Press Cmd+R to reload,\n" ++ "Cmd+D or shake for dev menu" |
13 | | - | os when os == Platform.android => |
14 | | - "Double tap R on your keyboard to reload,\n" |
15 | | - ++ "Shake or press menu button for dev menu" |
16 | | - | os when os == Platform.web => "Press Cmd+R to reload." |
17 | | - | _ => "" |
18 | | - }; |
19 | | - |
| 9 | +/* |
| 10 | + Here is StyleSheet that is using Style module to define styles for your components |
| 11 | + The main different with JavaScript components you may encounter in React Native |
| 12 | + is the fact that they **must** be defined before being referenced |
| 13 | + (so before actual component definitions) |
| 14 | + More at https://reasonml-community.github.io/reason-react-native/en/docs/apis/Style/ |
| 15 | + */ |
20 | 16 | let styles = |
21 | 17 | Style.( |
22 | 18 | StyleSheet.create({ |
@@ -44,5 +40,20 @@ let app = () => |
44 | 40 | <Text style=styles##instructions> |
45 | 41 | "To get started, edit src/App.re"->React.string |
46 | 42 | </Text> |
47 | | - <Text style=styles##instructions> instructions->React.string </Text> |
| 43 | + <Text style=styles##instructions> |
| 44 | + {switch (Platform.os) { |
| 45 | + /* |
| 46 | + Instructions depends on the platform this code will run on |
| 47 | + More at https://reasonml-community.github.io/reason-react-native/en/docs/apis/Platform/ |
| 48 | + */ |
| 49 | + | os when os == Platform.ios => |
| 50 | + "Press Cmd+R to reload,\n" ++ "Cmd+D or shake for dev menu" |
| 51 | + | os when os == Platform.android => |
| 52 | + "Double tap R on your keyboard to reload,\n" |
| 53 | + ++ "Shake or press menu button for dev menu" |
| 54 | + | os when os == Platform.web => "Press Cmd+R to reload." |
| 55 | + | _ => "" |
| 56 | + }} |
| 57 | + ->React.string |
| 58 | + </Text> |
48 | 59 | </View>; |
0 commit comments