Skip to content

Commit

Permalink
exploring state and events - part 4
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenGrider committed Mar 29, 2015
1 parent 86d0dc1 commit b2bf2d4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dropdown/src/dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@

var React = require('react');
var Button = require('./button');
// var List = require('./list');
var ListItem = require('./list-item');

module.exports = React.createClass({
handleClick: function() {
alert('hello from dropdown');
},
render: function() {
var list = this.props.items.map(function(item){
return <ListItem item={item} />
});

return <div className="dropdown">
<Button
Expand All @@ -19,6 +22,9 @@ module.exports = React.createClass({
title={this.props.title}
subTitleClassName="caret"
/>
<ul>
{list}
</ul>
</div>
}
});
7 changes: 7 additions & 0 deletions dropdown/src/list-item.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var React = require('react');

module.exports = React.createClass({
render: function() {
return <li><a>{this.props.item}</a></li>
}
});

0 comments on commit b2bf2d4

Please sign in to comment.