Переглянути джерело

Listing 8: Hook up the data model step1: data out of the component.

Frederic G. MARAND 8 роки тому
батько
коміт
88eb2bb7c9
1 змінених файлів з 5 додано та 0 видалено
  1. 5 0
      public/scripts/tutorial.js

+ 5 - 0
public/scripts/tutorial.js

@@ -1,3 +1,8 @@
+let data = [
+  { id: 1, author: "Pete Hunt", text: "This is one comment" },
+  { id: 2, author: "Jordan Walke", text: "This is *another* comment" }
+];
+
 let Comment = React.createClass({
   rawMarkup: function () {
     let rawMarkup = marked(this.props.children.toString(), { sanitize: true });