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