Bladeren bron

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

Frederic G. MARAND 8 jaren geleden
bovenliggende
commit
88eb2bb7c9
1 gewijzigde bestanden met toevoegingen van 5 en 0 verwijderingen
  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 });