Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//fb.me/react-0.13.1.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
    var Child = React.createClass({
      render: function () {
        return <a onClick={this.props.onClick.bind(null, this)}>Click me</a>;
      }
    });
    var Parent = React.createClass({
      onClick: function (component, event) {
        console.log(component, event);
      },
      render: function() {
        return <Child onClick={this.onClick} />;
      }
    });
    
    React.render(<Parent />, document.body);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
chantasticpro
0viewers