Last active
February 6, 2019 17:34
-
-
Save scull7/61c88422073c7eda376fffd45f5209be to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Page = { | |
type action = | |
| NoOp; | |
type ledger = { | |
id: string, | |
statementId: string, | |
actor: string, | |
influencer: string, | |
referenceType: string, | |
paymentId: string, | |
amount: string, | |
timestamp: int | |
}; | |
type state = { items: list(ledger) }; | |
let component = ReasonReact.reducerComponent("PageSearch"); | |
let make = _children => { | |
...component, | |
initialState: () => { items: [] }, | |
reducer: (action, _state: state) => | |
switch (action) { | |
| NoOp => ReasonReact.NoUpdate | |
}, | |
render: _self => | |
<div> | |
<div className="search-bar-container"> | |
<table className="ledger"> <TableHeader /> </table> | |
</div> | |
</div> | |
}; | |
}; | |
let render = root => ReactDOMRe.render(<Page />, root); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks to the very helpful hello123#8705 on the ReasonML discord channel, I learned that you have to annotate the state variable so that the program will compile.