Pārlūkot izejas kodu

Step 8.3: Add toggleHideCompleted handler to App.

Frederic G. MARAND 9 gadi atpakaļ
vecāks
revīzija
89ea5bd630
1 mainītis faili ar 7 papildinājumiem un 1 dzēšanām
  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