Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isConnecting returns true even when wallet is not connected on client-side route change (Remix) #388

Closed
1 task done
jcheese1 opened this issue Apr 30, 2022 · 2 comments
Closed
1 task done

Comments

@jcheese1
Copy link

jcheese1 commented Apr 30, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

0.3.0

Current Behavior

isConnecting returns true on client-side route transition, even when you don't have a wallet connected.

Repro here:
https://codesandbox.io/s/vigilant-firefly-guj5zt

As you can see, isConnected becomes true on route change above

Also, when connected to a wallet, switching between pages loses the activeConnector field and becomes undefined for some reason. That bug can also be repro'd on the link above.

Expected Behavior

  • isConnected remains false even after route change
  • activeConnector to be defined on route change after wallet connection established

Steps To Reproduce

No response

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

https://codesandbox.io/s/pedantic-agnesi-r8dn22

Anything else?

isConnected bug:
https://user-images.githubusercontent.com/15570714/166090160-86c4ee0e-a3c6-4fe5-bc1f-34da25f1412c.mp4

activeConnector bug:
https://user-images.githubusercontent.com/15570714/166090161-e553db9c-0e47-4fdf-85dd-47cd22d0f917.mp4

@jxom
Copy link
Member

jxom commented May 1, 2022

@jcheese1 – you may need to memoize the createClient creation with useMemo. I have updated the example to reflect this.

@jxom jxom closed this as completed May 1, 2022
Copy link
Contributor

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants