Skip to content

Commit

Permalink
Event binding in componentDidMount
Browse files Browse the repository at this point in the history
doing event binding in componentWillMount means that if this view is ever rendered server side, you'll have a leak because componentWillUnmount will never be called.
  • Loading branch information
Patrick Williams committed Feb 23, 2015
1 parent e3bbf46 commit 03eaff8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/todoApp/js/todoAppFirebaseImplicit.js
Expand Up @@ -15,7 +15,7 @@ var TodoApp3 = React.createClass({
return {items: [], text: ""};
},

componentWillMount: function() {
componentDidMount: function() {
var firebaseRef = new Firebase("https://ReactFireTodoApp.firebaseio.com/items/");
this.bindAsArray(firebaseRef.limitToLast(25), "items");
},
Expand Down

0 comments on commit 03eaff8

Please sign in to comment.