Skip to content Skip to sidebar Skip to footer

Trouble Accessing Props In Callback Function Of Google Login Using React-google-login

I'm using react-google-login in my react-redux project and having trouble accessing the props for the component in which this login button exists. I used react-facebook-login in a

Solution 1:

Try change loginGoogle definition to Arrow function: loginGoogle(response) { => loginGoogle = (response) => {

An arrow function does not create its own "this", the this value of the enclosing execution context is used.

Or you may bind loginGoogle method, refer to this answer: Why JSX props should not use arrow functions

Post a Comment for "Trouble Accessing Props In Callback Function Of Google Login Using React-google-login"