-
Notifications
You must be signed in to change notification settings - Fork 50.6k
Closed
Description
I’ve seen the “rendered fewer hooks than expected” invariant a couple times now pointing at a component rendered as a part of an error boundary that just caught an error when that component does not use hooks at all.
I’ve been able to fix this issue by un-commenting:
react/packages/react-reconciler/src/ReactFiberHooks.js
Lines 372 to 382 in 8af1f87
| // The following should have already been reset | |
| // currentHook = null; | |
| // workInProgressHook = null; | |
| // remainingExpirationTime = NoWork; | |
| // componentUpdateQueue = null; | |
| // didScheduleRenderPhaseUpdate = false; | |
| // renderPhaseUpdates = null; | |
| // numberOfReRenders = 0; | |
| // sideEffectTag = 0; |
I haven’t been able to produce a minimal test-case yet 😣. I’m reporting anyway with the temporary fix that worked for me in case you have any insight on what a minimal test-case could be. I’ll update this issue if I keep running into the problem and I can create a minimal test-case.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels