Skip to content

Instantly share code, notes, and snippets.

@scull7
Last active February 6, 2019 17:34
Show Gist options
  • Save scull7/61c88422073c7eda376fffd45f5209be to your computer and use it in GitHub Desktop.
Save scull7/61c88422073c7eda376fffd45f5209be to your computer and use it in GitHub Desktop.
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);
@scull7
Copy link
Author

scull7 commented Jan 21, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment