(current, workInProgress, renderExpirationTime)
| 10152 | } |
| 10153 | |
| 10154 | function updateHostComponent(current, workInProgress, renderExpirationTime) { |
| 10155 | pushHostContext(workInProgress); |
| 10156 | |
| 10157 | if (current === null) { |
| 10158 | tryToClaimNextHydratableInstance(workInProgress); |
| 10159 | } |
| 10160 | |
| 10161 | var type = workInProgress.type; |
| 10162 | var memoizedProps = workInProgress.memoizedProps; |
| 10163 | var nextProps = workInProgress.pendingProps; |
| 10164 | var prevProps = current !== null ? current.memoizedProps : null; |
| 10165 | |
| 10166 | if (hasLegacyContextChanged()) { |
| 10167 | // Normally we can bail out on props equality but if context has changed |
| 10168 | // we don't do the bailout and we have to reuse existing props instead. |
| 10169 | } else if (memoizedProps === nextProps) { |
| 10170 | var isHidden = workInProgress.mode & AsyncMode && shouldDeprioritizeSubtree(type, nextProps); |
| 10171 | if (isHidden) { |
| 10172 | // Before bailing out, make sure we've deprioritized a hidden component. |
| 10173 | workInProgress.expirationTime = Never; |
| 10174 | } |
| 10175 | if (!isHidden || renderExpirationTime !== Never) { |
| 10176 | return bailoutOnAlreadyFinishedWork(current, workInProgress); |
| 10177 | } |
| 10178 | // If we're rendering a hidden node at hidden priority, don't bailout. The |
| 10179 | // parent is complete, but the children may not be. |
| 10180 | } |
| 10181 | |
| 10182 | var nextChildren = nextProps.children; |
| 10183 | var isDirectTextChild = shouldSetTextContent(type, nextProps); |
| 10184 | |
| 10185 | if (isDirectTextChild) { |
| 10186 | // We special case a direct text child of a host node. This is a common |
| 10187 | // case. We won't handle it as a reified child. We will instead handle |
| 10188 | // this in the host environment that also have access to this prop. That |
| 10189 | // avoids allocating another HostText fiber and traversing it. |
| 10190 | nextChildren = null; |
| 10191 | } else if (prevProps && shouldSetTextContent(type, prevProps)) { |
| 10192 | // If we're switching from a direct text child to a normal child, or to |
| 10193 | // empty, we need to schedule the text content to be reset. |
| 10194 | workInProgress.effectTag |= ContentReset; |
| 10195 | } |
| 10196 | |
| 10197 | markRef(current, workInProgress); |
| 10198 | |
| 10199 | // Check the host config to see if the children are offscreen/hidden. |
| 10200 | if (renderExpirationTime !== Never && workInProgress.mode & AsyncMode && shouldDeprioritizeSubtree(type, nextProps)) { |
| 10201 | // Down-prioritize the children. |
| 10202 | workInProgress.expirationTime = Never; |
| 10203 | // Bailout and come back to this fiber later. |
| 10204 | workInProgress.memoizedProps = nextProps; |
| 10205 | return null; |
| 10206 | } |
| 10207 | |
| 10208 | reconcileChildren(current, workInProgress, nextChildren); |
| 10209 | memoizeProps(workInProgress, nextProps); |
| 10210 | return workInProgress.child; |
| 10211 | } |
no test coverage detected