Skip to content

Lesson 10 - Queries on enableWeb3 & deactivateWeb3 #2600

Answered by alymurtazamemon
levblanc asked this question in Q&A
Discussion options

You must be logged in to vote

@levblanc Hey! enableWeb3 is basically a react hook provided by react-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.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@levblanc
Comment options

@alymurtazamemon
Comment options

Answer selected by levblanc
Comment options

You must be logged in to vote
1 reply
@alymurtazamemon
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants