Open wenzi0github opened 2 years ago
ok, I got it.
Before updateWorkInProgressHook(), it will change workInProgress.memoizedState to null, and change currentlyRenderingFiber too. That means nextWorkInProgressHook always is null when rerendered by useState().
So, I have the second question, what time nextWorkInProgressHook will be not null.
when nextWorkInProgressHook is null but nextCurrentHook not in updateWorkInProgressHook?
https://github.com/wenzi0github/react/blob/8af5b16ac8836f7950510296f276a84268e3374e/packages/react-reconciler/src/ReactFiberHooks.old.js#L721