Want to use google sign in button with react? Try adding the onSuccess callback when you initialize the component in componentDidMount().
1 2 3 4 5 6 7 8 9 10 11 | 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 }); }, ... |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.