-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsrc.js
More file actions
30 lines (25 loc) · 660 Bytes
/
src.js
File metadata and controls
30 lines (25 loc) · 660 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var React = require('react');
var ReactBootstrap = require('react-bootstrap');
var DropdownButton = ReactBootstrap.DropdownButton;
var MenuItem = ReactBootstrap.MenuItem;
var App = React.createClass({
getInitialState: function() {
return {on: true};
},
handleClick: function() {
this.setState({on: false});
},
render: function() {
if (!this.state.on) {
return <div/>;
}
return (
<DropdownButton>
<MenuItem eventKey='1' onClick={this.handleClick}>Break things</MenuItem>
</DropdownButton>
);
}
});
window.onload = function() {
React.render(<App/>, document.getElementById('container'));
};