Skip to content

Commit 65eae7c

Browse files
committed
Firebase - Section 7
1 parent 952235f commit 65eae7c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

todos/src/app.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var App = React.createClass({
1515
<h2 className="text-center">
1616
To-Do List
1717
</h2>
18-
<Header />
18+
<Header itemsStore={this.firebaseRefs.items} />
1919
</div>
2020
</div>
2121
}

todos/src/header.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ module.exports = React.createClass({
2424
</div>
2525
},
2626
handleClick: function() {
27-
console.log(this.state.text);
27+
this.props.itemsStore.push({
28+
text: this.state.text,
29+
done: false
30+
});
31+
32+
this.setState({text: ''});
2833
},
2934
handleInputChange: function(event) {
3035
this.setState({text: event.target.value});

0 commit comments

Comments
 (0)