Created
May 10, 2017 20:20
-
-
Save rafayepes/afc0e26f5fcea51b6585019204117dab to your computer and use it in GitHub Desktop.
Reason JSX example
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
module App = { | |
include ReactRe.Component; | |
let name = "App"; | |
type props = { | |
dispatch: Store.action => unit, | |
state: Store.state, | |
}; | |
let className: string = | |
Styles.make | |
alignItems::"center" | |
display::"flex" | |
flexDirection::"column" | |
() | |
|> Styles.className; | |
let render { props: { dispatch, state: { operations } } } => { | |
let output = Operation.getInput operations; | |
<main className> | |
<Hero /> | |
<Calculator> | |
<Display output /> | |
<Buttons dispatch /> | |
</Calculator> | |
</main>; | |
}; | |
}; | |
include ReactRe.CreateComponent App; | |
let createElement ::state ::dispatch => wrapProps { dispatch, state }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment