Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.rawgit.com/lodash/lodash/3.0.1/lodash.min.js"></script>
<script src="//fb.me/react-0.14.0-rc1.js"></script>
<script src="//fb.me/react-dom-0.14.0-rc1.js"></script>
<script src="https://code.jquery.com/jquery.min.js"></script>
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">-->
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">-->
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <div id="react-app-container"></container>
</div>
</body>
</html>
 
class Application extends React.Component {
  constructor() {
    super();
    this.state = { containerId: "" };
  }
  componentDidMount() {
    this.setState({
      containerId: ReactDOM.findDOMNode(this).parentNode.getAttribute("id")
    });
  }
  render() {
    return <div>My container's ID is: {this.state.containerId}</div>;
  }
}
ReactDOM.render(<Application />, document.getElementById("react-app-container"));
Output 300px

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

Dismiss x
public
Bin info
BinaryMusepro
0viewers