Explorar o código

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

Frederic G. MARAND %!s(int64=9) %!d(string=hai) anos
pai
achega
42709ab655
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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")
 );