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

fix: allow excessive hydration to fix hanging isReconnecting state #3492

Closed
wants to merge 3 commits into from

Conversation

dalechyn
Copy link
Collaborator

As far as I've understood, the const active = useRef(true) was there to really make sure the effect is run just once as React doesn't guarantee that an effect won't be re-run once again, and for the same reason the dependencies were empty to minimize the redundant effect calls.

However, I think the effect still has to be run as during hot-reload component might get remounted with all connectors hanging in isReconnecting: true state.

Using this as a workaround for now.

Might fix #3490, yet also prune to excessive re-connects that might cause UI regressions, idk.

Description

What changes are made in this PR? Is it a feature or a bug fix?

Additional Information

Before submitting this issue, please make sure you do the following.

  • Read the contributing guide
  • Added documentation related to the changes made.
  • Added or updated tests (and snapshots) related to the changes made.

As far as I've understood, the `const active = useRef(true)` was there to really make sure the effect is run just once as React doesn't guarantee that an effect won't be re-run once again, and for the same reason the dependencies were empty to minimize the redundant effect calls.

However, I think the effect still has to be run as during hot-reload component might get remounted with all connectors hanging in `isReconnecting: true` state.

Using this as a workaround for now.

Might fix wevm#3490, yet also prune to excessive re-connects that might cause UI regressions, idk.
Copy link

changeset-bot bot commented Jan 21, 2024

⚠️ No Changeset found

Latest commit: 418703a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Jan 21, 2024

@dalechyn is attempting to deploy a commit to the wagmi Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Jan 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wagmi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 21, 2024 1:25pm

@jxom
Copy link
Member

jxom commented Mar 18, 2024

Closing in favor of #3715

@jxom jxom closed this Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wagmi stays in the reconnecting: true state during the hot-reload
2 participants