JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/hyperflux@0.0.0-alpha1/dist/hyperflux.js"></script>
<div id="container">
<!-- This element's contents will be replaced with your component. -->
</div>
Babel + JSX
const state = {
count: 0,
};
const actions = {
inc: () => state => ({ count: state.count + 1 }),
dec: () => state => ({ count: state.count - 1 }),
};
const Counter = props => (
<div>
Count: {props.count} <button onClick={props.inc} >+</button> <button onClick={props.dec}>-</button>
</div>
);
const render = (state, actions) => ReactDOM.render(
<Counter
count={state.count}
inc={actions.inc}
dec={actions.dec}
/>,
document.getElementById('container')
);
hyperflux.app(state, actions, render);