Lesson 10 - Queries on enableWeb3
& deactivateWeb3
#2600
-
Hi, I've tried to search on Google and Moralis docs, but couldn't find any result. I guess my next step would be to read Moralis source code. Please feel free to share your ideas and leave your comments. In lesson 10, when we use But in the My queries:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
@levblanc Hey! In the Hope it clears your all queries. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the q @levblanc and a @alymurtazamemon - I also had similar questions. @alymurtazamemon, isn't @levblanc, to riff on your third question, it seems that by calling |
Beta Was this translation helpful? Give feedback.
@levblanc Hey!
enableWeb3
is basically areact
hook provided byreact-moralis
that is just like the normal bool variable but because it reacts hook it renders the website.In the
onClick
we await because we want to wait for the confirmation and only on the success, we want to change the value in local storage. But in the useEffect we do not want to do other things and we do not need to wait for it to perform other things, because those we are already verifying like,isWeb3Enable
and local storage has true value, and window is not undefined.Hope it clears your all queries.