Skip to content

Commit

Permalink
exploring props - part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenGrider committed Mar 15, 2015
1 parent d67b329 commit 0f49ee5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions badge/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@
// Define a `class`
var Badge = React.createClass({
render: function() {
return <button class="btn btn-primary" type="button">
Messages <span class="badge">4</span>

return <button className="btn btn-primary" type="button">
{this.props.title} <span className="badge">{this.props.number}</span>
</button>
}
});

var options = {
title: 'Sent',
number: 12
};

// React, please render this class
var element = React.createElement(Badge);
var element = React.createElement(Badge, options);

// React, after you render this class, please place it in my body tag
React.render(element, document.body);
Expand Down

0 comments on commit 0f49ee5

Please sign in to comment.