type action = | Add; let component = ReasonReact.reducerComponent("Counter"); let make = (_children) => { ...component, initialState: () => 0, reducer: (action, state) => switch action { | Add => ReasonReact.Update(state + 1) }, render: (self) => { let countMsg = "Count: " ++ string_of_int(self.state);
(ReasonReact.stringToElement(countMsg))