-
Notifications
You must be signed in to change notification settings - Fork 222
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I have the following code:
'use client'
import { useEffect, useState } from 'react'
import { useAccount } from 'wagmi'
export default function Home() {
const { isConnected, address, status } = useAccount()
useEffect(() => {
console.log(isConnected)
console.log(address)
console.log(status)
}, [isConnected, address, status])And on my UI, Metamask is clearly connected (my metamask, show it's connected to the site, and you can see the address of my metamask being console.logged out):
Whenever I refresh the page, it just keeps saying not connected
To reproduce
- Use the
import { useAccount } from 'wagmi'hook, and in a component, add:
export default function Home() {
const { isConnected, address, status } = useAccount()
useEffect(() => {
console.log(isConnected)
console.log(address)
console.log(status)
}, [isConnected, address, status])
- Connect your metamask with a
connectbutton - Refresh the page, it'll always have
isConnectedbe false
Optionally, you can see this repo for more information.
Expected behavior
isConnected should be true, as my Metamask says it's true
Screenshots
See above
Environment details
nodejs: v23.5.0
"wagmi": "^2.14.9"
"connectkit": "^1.8.2",
Tagging @PatrickAlphaC
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working