Skip to content

Commit

Permalink
Fix setstate warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lisamburns committed Feb 23, 2016
1 parent 0255aee commit d94da17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/js/components/Facebook/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Main extends React.Component {

componentDidMount () {
FacebookActionCreators.initFacebook();
this.changeListener = this._onFacebookChange();
this.changeListener = this._onFacebookChange.bind(this);
FacebookStore.addChangeListener(this.changeListener);
}

Expand Down
11 changes: 6 additions & 5 deletions src/js/routes/More/SignIn.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,18 @@ export default class SignIn extends Component {
});

FacebookActionCreators.initFacebook();
FacebookStore.addChangeListener(() => this._onFacebookChange());

this.changeListener = this._onFacebookChange.bind(this);
FacebookStore.addChangeListener(this.changeListener);
this.voterListener = this._onVoterStoreChange.bind(this);
// console.log("SignIn componentDidMount VoterStore.addChangeListener");
VoterStore.addChangeListener(this._onVoterStoreChange.bind(this));
VoterStore.addChangeListener(this.voterListener);
}

componentWillUnmount () {
FacebookStore.removeChangeListener(this._onFacebookChange);
FacebookStore.removeChangeListener(this.changeListener);

// console.log("SignIn componentWillUnmount VoterStore.removeChangeListener");
VoterStore.removeChangeListener(this._onVoterStoreChange.bind(this));
VoterStore.removeChangeListener(this.voterListener);
}

_onVoterStoreChange () {
Expand Down

0 comments on commit d94da17

Please # to comment.