Skip to content

Commit 3e1e779

Browse files
Update README.md
1 parent dfb3688 commit 3e1e779

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ import firebase from './firebase.js';
158158

159159
class MyComponent extends React.Component {
160160
state = {
161-
todoList: {},
162-
newTodoText: ''
161+
todoList: {}, // Mirrors the Todo lsit in Firebase.
162+
newTodoText: '', // Mirrors the new Todo Text field in the UI.
163163
};
164164

165165
componentDidMount() {
@@ -176,6 +176,7 @@ class MyComponent extends React.Component {
176176
this.firebaseRef.off('value', this.firebaseCallback);
177177
}
178178

179+
// This is triggered when the "Add New Todo" button is clicked.
179180
onSubmit(e) {
180181
e.preventDefault();
181182
// Add the new todo to Firebase.
@@ -190,7 +191,7 @@ class MyComponent extends React.Component {
190191
}
191192
```
192193

193-
Note how we are not updating the `todoList` in the local state. You only need to update Firebase and the Firebase observer that was set up will take care of propagating the changes and updating the local state.
194+
Note how we are **not** updating the `todoList` in the local state. You only need to update Firebase and the Firebase observer that was set up will take care of propagating the changes and updating the local state.
194195

195196

196197
## Migrating from ReactFire

0 commit comments

Comments
 (0)