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

"Hooks reset" not working #1393

Closed
nfarina opened this issue Nov 14, 2019 · 5 comments · Fixed by #1394 · May be fixed by novalina26/anchor#1
Closed

"Hooks reset" not working #1393

nfarina opened this issue Nov 14, 2019 · 5 comments · Fixed by #1394 · May be fixed by novalina26/anchor#1

Comments

@nfarina
Copy link

nfarina commented Nov 14, 2019

Description

First off, thanks so much for your tireless work on this project! This is the most essential dev tool I use.

In the README, it states:

Hooks would be reset if their order changes. Adding, removing or moving around would cause a local tree remount.

Sounds amazing! This is exactly what I want. However, it doesn't seem to be doing this.

Expected behavior

I see in the source for react-hot-loader this promising line:

⚛️🔥🎣 Hook order change detected: …

But I never see that. I've also set a breakpoint on that line and it's never called.

Actual behavior

Changing hook order or adding/removing hooks results in the usual errors from React:

  • "Should have a queue."
  • "Rendered fewer hooks than expected."
  • etc.

Environment

React Hot Loader version: 4.12.17

Run these commands in the project folder and fill in their results:

  1. node -v: v12.11.0
  2. npm -v: 6.11.3

Then, specify:

  1. Operating system: macOS 10.15.1
  2. Browser and version: Chrome Canary 80.0.3965.0

Reproducible Demo

Minimal project: https://github.com/nfarina/hooktest

@theKashey
Copy link
Collaborator

👍, could not resist so perfect issue. Looking into it right now...

@theKashey
Copy link
Collaborator

Founds issues:

Solutions:

@Bnaya
Copy link
Contributor

Bnaya commented Nov 14, 2019

😪🤭

@theKashey
Copy link
Collaborator

4.12.18 has been released

@nfarina
Copy link
Author

nfarina commented Nov 16, 2019

Amazing!! Thanks so much for fixing this so quickly—the Hooks Reset feature is a major time-saver. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment