Parcourir la source

Listing 9: Hook up the data model step2: pass data to CommentBox, then CommentList.

Frederic G. MARAND il y a 8 ans
Parent
commit
42709ab655
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      public/scripts/tutorial.js

+ 2 - 2
public/scripts/tutorial.js

@@ -46,7 +46,7 @@ let CommentBox = React.createClass({
     return (
       <div className="commentBox">
         <h1>Comments</h1>
-        <CommentList />
+        <CommentList data={this.props.data} />
         <CommentForm />
         </div>
     );
@@ -54,6 +54,6 @@ let CommentBox = React.createClass({
 });
 
 ReactDOM.render(
-  <CommentBox />,
+  <CommentBox data={data} />,
   document.getElementById("content")
 );