@@ -33,66 +33,10 @@ export { app as default } from "./src/App.bs.js";
|
33 | 33 |
|
34 | 34 | ## `./src/App.re`
|
35 | 35 |
|
36 |
| -👀 In place of the rudimentary example below, you can directly grab the |
37 |
| -[App.re](https://raw.usercontent.com/reason-react-native/reason-react-native/master/reason-react-native-template/template/src/App.re) |
| 36 | +Please directly grab the |
| 37 | +[App.re](https://.com/reason-react-native/template/blob/master/template/src/App.re) |
38 | 38 | of our template, which will match React Native default _Hello World_!
|
39 | 39 |
|
40 |
| -```reason |
41 |
| -open ReactNative; |
42 |
| -
|
43 |
| -/* |
44 |
| -Here is StyleSheet that is using Style module to define styles for your components |
45 |
| -The main different with JavaScript components you may encounter in React Native |
46 |
| -is the fact that they **must** be defined before being referenced |
47 |
| -(so before actual component definitions) |
48 |
| -More at https://reasonml-community..io/en/docs/apis/Style/ |
49 |
| -*/ |
50 |
| -let styles = |
51 |
| -Style.( |
52 |
| -StyleSheet.create({ |
53 |
| -"container": |
54 |
| -style( |
55 |
| -~flex=1., |
56 |
| -~justifyContent=`center, |
57 |
| -~alignItems=`center, |
58 |
| -~backgroundColor="#F5FCFF", |
59 |
| -(), |
60 |
| -), |
61 |
| -"welcome": |
62 |
| -style(~fontSize=20., ~textAlign=`center, ~margin=10.->dp, ()), |
63 |
| -"instructions": |
64 |
| -style(~textAlign=`center, ~color="#333333", ~marginBottom=5.->dp, ()), |
65 |
| -}) |
66 |
| -); |
67 |
| -
|
68 |
| -[@react.component] |
69 |
| -let app = () => |
70 |
| -<View style=styles##container> |
71 |
| -<Text style=styles##welcome> |
72 |
| -"Welcome to (Reason) React Native!"->React.string |
73 |
| -</Text> |
74 |
| -<Text style=styles##instructions> |
75 |
| -"To get started, edit src/App.re"->React.string |
76 |
| -</Text> |
77 |
| -<Text style=styles##instructions> |
78 |
| -{switch (Platform.os) { |
79 |
| -/* |
80 |
| -Instructions depends on the platform this code will run on |
81 |
| -More at https://reasonml-community..io/en/docs/apis/Platform/ |
82 |
| -*/ |
83 |
| -| os when os == Platform.ios => |
84 |
| -"Press Cmd+R to reload,\n" ++ "Cmd+D or shake for dev menu" |
85 |
| -| os when os == Platform.android => |
86 |
| -"Double tap R on your keyboard to reload,\n" |
87 |
| -++ "Shake or press menu button for dev menu" |
88 |
| -| os when os == Platform.web => "Press Cmd+R to reload." |
89 |
| -| _ => "" |
90 |
| -}} |
91 |
| -->React.string |
92 |
| -</Text> |
93 |
| -</View>; |
94 |
| -``` |
95 |
| - |
96 | 40 | ### Differences with React Native JavaScript
|
97 | 41 |
|
98 | 42 | Beside Reason syntax that is a bit different with JavaScript, you may have
|
|
0 commit comments