import React from "react"; import { ReComponent, Update } from "react-recomponent"; class Counter extends ReComponent { constructor() { super(); this.handleClick = this.createSender("CLICK"); this.state = { count: 0 }; } static reducer(action, state) { switch (action.type) { case "CLICK": return Update({ count: state.count + 1 }); } } render() { return ( ); } }