Last active
December 4, 2017 02:10
-
-
Save brentvatne/2232af699480b09864f40389703cbabf to your computer and use it in GitHub Desktop.
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 ReactNative; | |
/* This could live in the Style module so it works more nicely with `open Style` in `module Styles` block */ | |
let createStyle = (sarr) => { | |
/* If we expose ReactNativePropRegistry.register(styleObj) then we don't need to allocate an object here */ | |
/* -- instead, we can just return the result of that. */ | |
let sheet = StyleSheet.create({"x": Style.style(sarr)}); | |
sheet##x; | |
}; | |
module Styles = { | |
open Style; | |
let titleText = createStyle([fontSize(20.0), fontWeight(`_500)]); | |
let container = createStyle([flex(1.0), justifyContent(`center), alignItems(`center)]); | |
}; | |
let app = () => | |
<View style=Styles.container> | |
<Text value="Hello from ReasonML! This is neato!!!!" style=Styles.titleText /> | |
</View>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment