Skip to content

Instantly share code, notes, and snippets.

@brentvatne
Last active December 4, 2017 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brentvatne/2232af699480b09864f40389703cbabf to your computer and use it in GitHub Desktop.
Save brentvatne/2232af699480b09864f40389703cbabf to your computer and use it in GitHub Desktop.
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