(current, pendingProps, expirationTime)
| 6229 | |
| 6230 | // This is used to create an alternate fiber to do work on. |
| 6231 | function createWorkInProgress(current, pendingProps, expirationTime) { |
| 6232 | var workInProgress = current.alternate; |
| 6233 | if (workInProgress === null) { |
| 6234 | // We use a double buffering pooling technique because we know that we'll |
| 6235 | // only ever need at most two versions of a tree. We pool the "other" unused |
| 6236 | // node that we're free to reuse. This is lazily created to avoid allocating |
| 6237 | // extra objects for things that are never updated. It also allow us to |
| 6238 | // reclaim the extra memory if needed. |
| 6239 | workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode); |
| 6240 | workInProgress.type = current.type; |
| 6241 | workInProgress.stateNode = current.stateNode; |
| 6242 | |
| 6243 | { |
| 6244 | // DEV-only fields |
| 6245 | workInProgress._debugID = current._debugID; |
| 6246 | workInProgress._debugSource = current._debugSource; |
| 6247 | workInProgress._debugOwner = current._debugOwner; |
| 6248 | } |
| 6249 | |
| 6250 | workInProgress.alternate = current; |
| 6251 | current.alternate = workInProgress; |
| 6252 | } else { |
| 6253 | workInProgress.pendingProps = pendingProps; |
| 6254 | |
| 6255 | // We already have an alternate. |
| 6256 | // Reset the effect tag. |
| 6257 | workInProgress.effectTag = NoEffect; |
| 6258 | |
| 6259 | // The effect list is no longer valid. |
| 6260 | workInProgress.nextEffect = null; |
| 6261 | workInProgress.firstEffect = null; |
| 6262 | workInProgress.lastEffect = null; |
| 6263 | } |
| 6264 | |
| 6265 | workInProgress.expirationTime = expirationTime; |
| 6266 | |
| 6267 | workInProgress.child = current.child; |
| 6268 | workInProgress.memoizedProps = current.memoizedProps; |
| 6269 | workInProgress.memoizedState = current.memoizedState; |
| 6270 | workInProgress.updateQueue = current.updateQueue; |
| 6271 | |
| 6272 | // These will be overridden during the parent's reconciliation |
| 6273 | workInProgress.sibling = current.sibling; |
| 6274 | workInProgress.index = current.index; |
| 6275 | workInProgress.ref = current.ref; |
| 6276 | |
| 6277 | return workInProgress; |
| 6278 | } |
| 6279 | |
| 6280 | function createHostRootFiber(isAsync) { |
| 6281 | var mode = isAsync ? AsyncMode | StrictMode : NoContext; |
no test coverage detected