( current: Fiber | null, workInProgress: Fiber, nextProps: any, Component: any, secondArg: any, renderLanes: Lanes, )
| 1532 | } |
| 1533 | |
| 1534 | export function replayFunctionComponent( |
| 1535 | current: Fiber | null, |
| 1536 | workInProgress: Fiber, |
| 1537 | nextProps: any, |
| 1538 | Component: any, |
| 1539 | secondArg: any, |
| 1540 | renderLanes: Lanes, |
| 1541 | ): Fiber | null { |
| 1542 | // This function is used to replay a component that previously suspended, |
| 1543 | // after its data resolves. It's a simplified version of |
| 1544 | // updateFunctionComponent that reuses the hooks from the previous attempt. |
| 1545 | |
| 1546 | prepareToReadContext(workInProgress, renderLanes); |
| 1547 | if (enableSchedulingProfiler) { |
| 1548 | markComponentRenderStarted(workInProgress); |
| 1549 | } |
| 1550 | const nextChildren = replaySuspendedComponentWithHooks( |
| 1551 | current, |
| 1552 | workInProgress, |
| 1553 | Component, |
| 1554 | nextProps, |
| 1555 | secondArg, |
| 1556 | ); |
| 1557 | const hasId = checkDidRenderIdHook(); |
| 1558 | if (enableSchedulingProfiler) { |
| 1559 | markComponentRenderStopped(); |
| 1560 | } |
| 1561 | |
| 1562 | if (current !== null && !didReceiveUpdate) { |
| 1563 | bailoutHooks(current, workInProgress, renderLanes); |
| 1564 | return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); |
| 1565 | } |
| 1566 | |
| 1567 | if (getIsHydrating() && hasId) { |
| 1568 | pushMaterializedTreeId(workInProgress); |
| 1569 | } |
| 1570 | |
| 1571 | // React DevTools reads this flag. |
| 1572 | workInProgress.flags |= PerformedWork; |
| 1573 | reconcileChildren(current, workInProgress, nextChildren, renderLanes); |
| 1574 | return workInProgress.child; |
| 1575 | } |
| 1576 | |
| 1577 | function updateClassComponent( |
| 1578 | current: Fiber | null, |
no test coverage detected