checkConnection()
0xZakk opened this issue · comments
nextjs-gitcoin-passport/app/page.tsx
Lines 33 to 46 in e44fd53
Do we need to invoke and then define the function on the next line like this?
hey, I'm not sure I follow the question here
this function just checks their connection and automatically fetches their score if they've already connected.
My question is just about the formatting (defining and then invoking a function, all inside of a function). Could we make the parent function async and move everything from checkConnection
out into the parent function? Or is there a technical reason it has to be inside a separate function?
AH! yes, great question, you cannot (or are not supposed to do this) due to how useEffect
works, there's some discussion about those details here
Ahh okay - good to know