Open frankcollins3 opened 1 year ago
{clientId.length
?
<GoogleLogin
onSuccess={onSuccess}
onFailure={onFailure}
clientId={clientId}
// clientId={GOOGLE_clientId}
buttonText="text"
cookiePolicy={'single_host_origin'}
// isSignedIn={true}
/>
:
<pre></pre>
}
clientId ? not sure if the empty string will validate the truthy argument of this ternary operator. clientId.length ?
👎 no change either way [2:48pm]
new proposed approach: this ternary arg setup isn't doing what is intended because the google component button never renders. The new approach is to put that ternary argument only on the clientId
[2:53pm]
async error: "value is used before being assigned"
[2:57pm]
start() function works with same clientId with which it worked before.
I believe this is an SDLC issue.
👎 component wants the clientID ready by the time it renders. There is an ImmediatelyInvokedFunc() in useEffect() facilitating: the assigning of values to already globally declared variables.
let clientId:string = ''
<GoogleLogin clientId={clientId}
the component is interacting with the clientId variable before the useEffect() completes it reassigning of that value. The async factor is that GraphQL has to wait for the process.env from serverside to perform these functions. 👎 This is because the need for NODE_ENV to discern between {url: host:3000 || 'amazonEC2/app/production' }