A simple 2-component ReactJS app

http://jsbin.com/linagikecu/edit?html,css,js,output

var ChildComponent = React.createClass({
    render: function() {
        return (
            <div>
                <button onClick={this.props.clickButton}>Click Me</button>
            </div>
        );
    }
});


var ParentComponent = React.createClass({
    performMagic: function() {
        alert('Hello There');
    },

    render: function() {
        return(
            <div>
                <ChildComponent clickButton={this.performMagic}/>
            </div>
        );
    }
});

ReactDOM.render(<ParentComponent/>, document.getElementById('app'));