Skip to content

Instantly share code, notes, and snippets.

@knowbody
Created May 28, 2018 08:22
Show Gist options
  • Save knowbody/25a9541c707ce0e2e434e82e2c2e11fd to your computer and use it in GitHub Desktop.
Save knowbody/25a9541c707ce0e2e434e82e2c2e11fd to your computer and use it in GitHub Desktop.
Example `App.re` Reason React Native
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