I'm implementing the Facebook SDK on my react project, however, I am new to React and I still don't grasp some concepts. I'm calling handleFBLogin when a user clicks on a button. This function then calls checkLoginState to continue my code's logic. I've already bound checkLoginState in the constructor using:
this.CheckLoginState = this.checkLoginState.bind(this);
I call this function on handleFBLogin, but checkLoginState doesn't seem to be called. I can see the yes on my console:
handleFBLogin() { console.log("yes") this.checkLoginState; } Here's the checkLoginState function:
checkLoginState(){ console.log("checloginstate") window.FB.getLoginStatus(function(response) { console.log(response); this.statusChangeCallback(response); }.bind(this)); } Why isn't it being called?