Using google sign in button with react Using google sign in button with react javascript javascript

Using google sign in button with react


Try adding the onSuccess callback when you initialize the component in componentDidMount().

componentDidMount: function() {  gapi.signin2.render('g-signin2', {    'scope': 'https://www.googleapis.com/auth/plus.login',    'width': 200,    'height': 50,    'longtitle': true,    'theme': 'dark',    'onsuccess': this. onSignIn  });  },...