use-wallet icon indicating copy to clipboard operation
use-wallet copied to clipboard

useWallet() sometimes return null account value in it's object

Open softwaredev927 opened this issue 3 years ago • 1 comments

Code which I implemented to my react app for getting metamask info

<UseWalletProvider
                    chainId={NETWORK === 'mainnet' ? 1 : 4}
                    connectors={{
                    ...
</UseWalletProvider>
...

const wallet = useWallet()

wallet sometimes returns null account value in it's object like below.

account: null
balance: "-1"
chainId: 4
connect: Æ’ (t)
connector: "injected"
connectors: {fortmatic: Array(2), frame: Array(2), injected: Array(2), portis: Array(2), provided: Array(2), …}
error: null
ethereum: undefined
getBlockNumber: Æ’ ()
networkName: "Rinkeby"
reset: Æ’ ()
status: "connected"
type: null
...

With above issue, it's working fine when I refresh browser. Please let me know what should I do to solve this kinda issue.

softwaredev927 avatar Sep 12 '22 17:09 softwaredev927

having same issue

kingcozz avatar Oct 03 '22 19:10 kingcozz