wenzi0github / react

react源码的解析和学习

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

what time nextWorkInProgressHook is null but nextCurrentHook not in updateWorkInProgressHook?

wenzi0github opened this issue · comments

when nextWorkInProgressHook is null but nextCurrentHook not in updateWorkInProgressHook?

// Clone from the current hook.

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.