From 6a0a221b9cbd1a67268ea0cbc16cfba1aa804ac8 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Fri, 17 Apr 2015 18:44:26 +0800 Subject: [PATCH] Format --- react.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/react.md b/react.md index 62637c720..1d1034575 100644 --- a/react.md +++ b/react.md @@ -63,17 +63,16 @@ render: function () { ``` ### Setting defaults +Pre-populates `this.state.comments` and `this.props.name`. ```js React.createClass({ - // Pre-populates `this.state.data` getInitialState: function () { - return {data: []}; + return { comments: [] }; }, - // Pre-populates `this.props.name` getDefaultProps: function () { - return {name: ''}; + return { name: "Hello" }; } ); ```