Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
This repository was archived by the owner on May 22, 2025. It is now read-only.

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

@softwaredev927

Description

@softwaredev927

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions