瀏覽代碼

Step 8.2: Add getInitialState to App component.

Frederic G. MARAND 8 年之前
父節點
當前提交
cb9d84e210
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      App.jsx

+ 6 - 0
App.jsx

@@ -5,6 +5,12 @@ App = React.createClass({
   // This mixin makes the getMeteorData work.
   mixins: [ReactMeteorData],
 
+  getInitialState() {
+    return {
+      hideCompleted: false
+    };
+  },
+
   // Loads items from the Tasks collection and puts them on this.data.tasks.
   getMeteorData() {
     let result = {