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}> {this.props.text} </a>;
      }
    });
    var Parent = React.createClass({
      getInitialState: function () {
        return { text: "Click here" };
      },
      onClick: function (event) {
        // event.component.props ?why is this not available? 
      },
      render: function() {
        return <Child onClick={this.onClick} text={this.state.text} />;
      }
    });
    
    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