<html>
  <head></head>
  <body></body>
</html>
var HelloWorld = React.createClass({
    getInitialState: function() {
      return {
        greeting: ""
      };
    },
  
    greet: function() {
      this.setState({ greeting: "Hello, " + this.props.name + "!" });
    },
  
    render: function() {
        return <div>
          <button onClick={this.greet}>Greet</button>
          <br />
          <span>{this.state.greeting}</span>
        </div>;
    }
});

React.render(new HelloWorld({ name: "Chris Harrington" }), document.body);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. //codepen.io/chriscoyier/pen/yIgqi.js
  2. //cdnjs.cloudflare.com/ajax/libs/react/0.12.1/react.min.js
  3. //cdnjs.cloudflare.com/ajax/libs/react/0.12.2/JSXTransformer.js