Created
May 28, 2018 08:22
-
-
Save knowbody/25a9541c707ce0e2e434e82e2c2e11fd to your computer and use it in GitHub Desktop.
Example `App.re` Reason React Native
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open BsReactNative; | |
/* here we define some styles */ | |
module Styles = { | |
open Style; | |
let container = | |
style([ | |
flex(1.), | |
justifyContent(Center), | |
alignItems(Center), | |
backgroundColor(String("tomato")), | |
]); | |
let text = style([color(String("#fff")), fontSize(Float(24.))]); | |
}; | |
module Main = { | |
let component = ReasonReact.statelessComponent("Main"); | |
let make = _children => { | |
...component, | |
render: _self => | |
<View style=Styles.container> | |
<Text style=Styles.text> | |
(ReasonReact.string("Let's play with ReasonML!")) | |
</Text> | |
</View>, | |
}; | |
}; | |
let app = () => <Main />; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment