Skip to content

"Hooks reset" not working #1393

@nfarina

Description

@nfarina

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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions