tutorial.js 657 B

123456789101112131415161718192021222324252627282930313233343536
  1. let CommentList = React.createClass({
  2. render: function () {
  3. return (
  4. <div className="commentList">
  5. Hello, world! I am a CommentList.
  6. </div>
  7. );
  8. }
  9. });
  10. let CommentForm = React.createClass({
  11. render: function () {
  12. return (
  13. <div className="commentForm">
  14. Hello, world! I am a CommentForm.
  15. </div>
  16. );
  17. }
  18. });
  19. let CommentBox = React.createClass({
  20. render: function () {
  21. return (
  22. <div className="commentBox">
  23. <h1>Comments</h1>
  24. <CommentList />
  25. <CommentForm />
  26. </div>
  27. );
  28. }
  29. });
  30. ReactDOM.render(
  31. <CommentBox />,
  32. document.getElementById("content")
  33. );