//import React from 'react'; var App = React.createClass({displayName: 'App', getInitialState() { return { txt: 'this is initial state' }; }, update: function(e){ this.setState({txt: e.target.value}); }, render: function(){ return ( React.createElement("div", null, React.createElement("h1", null, this.state.txt), React.createElement(Widget, {update: this.update.bind(this)}) ) ) } }); var Widget = React.createClass({displayName: 'Widget', render: function(){ return ( React.createElement("input", {type: "text", onChange: this.props.update}) ) } }); React.render(React.createElement(App, null), document.body);