Browse Source

Step 8.3: Add toggleHideCompleted handler to App.

Frederic G. MARAND 8 years ago
parent
commit
89ea5bd630
1 changed files with 7 additions and 1 deletions
  1. 7 1
      App.jsx

+ 7 - 1
App.jsx

@@ -43,6 +43,12 @@ App = React.createClass({
     ReactDOM.findDOMNode(this.refs.textInput).value = '';
   },
 
+  toggleHideCompleted() {
+    this.setState({
+      hideCompleted: !this.state.hideCompleted
+    });
+  },
+
   render() {
     return (
       <div className="container">
@@ -50,7 +56,7 @@ App = React.createClass({
           <h1>Todo list</h1>
 
           <label className="hide-completed">
-            <input type="checkbox" readonly={true}
+            <input type="checkbox" readOnly={true}
                    checked={this.state.hideCompleted}
                    onClick={this.toggleHideCompleted} />
             Hide completed