From 0961884bbc7fa20b3cd89a4bb6eeedc4f2a2e5c7 Mon Sep 17 00:00:00 2001 From: Greg Back Date: Wed, 4 May 2016 22:59:28 -0500 Subject: [PATCH 1/2] Recreate example by following tutorial --- public/index.html | 6 +- public/scripts/example2.js | 131 +++++++++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 5 deletions(-) create mode 100644 public/scripts/example2.js diff --git a/public/index.html b/public/index.html index 34ebddf4..75bd08c5 100644 --- a/public/index.html +++ b/public/index.html @@ -13,10 +13,6 @@
- - + +
diff --git a/public/scripts/example2.js b/public/scripts/example2.js index 1e85e97e..04f1a086 100644 --- a/public/scripts/example2.js +++ b/public/scripts/example2.js @@ -5,11 +5,13 @@ var Comment = React.createClass({ }, render: function() { + var date = moment(this.props.id).fromNow(); return (

{this.props.author}

+ { date }
); @@ -71,7 +73,7 @@ var CommentList = React.createClass({ render: function() { var commentNodes = this.props.data.map(function(comment) { return ( - + {comment.text} );