2

Bug Description

The issue is that when I use walletconnect to connect, I get the walletconnect qr modal to open fine. The modal also closes when the qr code is scanned from and connected from trustwallet and metamask app on my android phone. But I am console logging the account and active variables from useWeb3React hook, and they come up as undefined.

This is not the problem with injected as I can see the account and active is also set as true after I connect.

Reproduction Codesandbox Link

Expected Behavior Active is set to true and account is set to wallet address

TylerH
  • 20,799
  • 66
  • 75
  • 101
Anas Shad
  • 179
  • 3
  • 11
  • Were you able to solve this? I'm only able to get `active`, `account`, `library`, etc. when I invoke `useWeb3React` from _another_ component, but the component that first invoked `activate` does not seem to have these properties once the connection is complete. – lux Dec 10 '21 at 22:55

1 Answers1

1

I was able to connect with WalletConnect to your reproduction app using Metamask and TrustWallet from my Android device, and from a Desktop app (Infinity Wallet), so your code is fine. Screenshot of connection.

Double check that you're connecting correctly in the Android app (hit connect), and that your accounts are legit (e.g. fully signed-up, security setup, etc.). Having a balance in your accounts doesn't matter.

Import error and setError from useWeb3React along with the others you're already importing. Use setError where you think the issue might be happening, then display it using error similarly to how you're displaying active.

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
jstep
  • 48
  • 7