JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdn.rawgit.com/5rsyoi/8f9c6f1ae216a9b35b88/raw/afa81a0516ec1510c2e8e9b0b5152b9ce986a722/apex.js"></script>
<div id="example">
<h1 a-ref="heading">...</h1>
<input a-ref="box">
</div>
JavaScript
var Example = apex.component(function() {
var component = this;
var heading = component.refs.heading;
var box = component.refs.box;
box.on('input', function() {
component.trigger('textChanged', {
value: box.$node.val()
});
});
component.on('textChanged', function(e, data) {
heading.$node.text(
data.value
);
});
});
Example.attachTo('#example');