Commit f523b2e
authored
Use fewer global variables in Hooks (#17480)
* We don't need the global state for this
* Move componentUpdateQueue and sideEffectTag out of global state
* Move firstWorkInProgressHook off global state
* Move remainingExpirationTime off global state
* Reset fiber to its current state if it throws
* Move rerender error check to avoid global state
This means that it's harder to find it since it's not in the dispatch
function's stack but we can add a DEV only one for that if we really
need it. Alternatively, we can check it in against the renderUpdates queue.
* Move next___Hook out of global state
* Assert that currentlyRenderingFiber is always set
When accessed, this should always be set. This could enforced by storing
this on the dispatcher for example.
* Add another test just to be safe1 parent d75323f commit f523b2e
File tree
3 files changed
+262
-114
lines changed- packages/react-reconciler/src
- __tests__
3 files changed
+262
-114
lines changed
0 commit comments