Skip to content

Commit

Permalink
Make an App component that contains the other bits
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdm committed Jun 1, 2015
1 parent 6b43550 commit ff224a2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
3 changes: 1 addition & 2 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<!doctype html>
<html>
<body>
<div id="sendMessageBox"></div>
<div id="messages"></div>
<div id="content"></div>

<script src="output.js"></script>
</body>
Expand Down
19 changes: 15 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,21 @@ var SendMessage = React.createClass({
}
});

React.render(
<MessageList />, document.getElementById('messages')
);
var App = React.createClass({
render: function() {
return (
<div>
<div>
<SendMessage />
</div>
<div>
<MessageList />
</div>
</div>
);
}
});

React.render(
<SendMessage />, document.getElementById('sendMessageBox')
<App />, document.getElementById('content')
);

0 comments on commit ff224a2

Please sign in to comment.