(current, workInProgress, renderExpirationTime)
| 10265 | } |
| 10266 | |
| 10267 | function updateHostComponent(current, workInProgress, renderExpirationTime) { |
| 10268 | pushHostContext(workInProgress); |
| 10269 | |
| 10270 | if (current === null) { |
| 10271 | tryToClaimNextHydratableInstance(workInProgress); |
| 10272 | } |
| 10273 | |
| 10274 | var type = workInProgress.type; |
| 10275 | var memoizedProps = workInProgress.memoizedProps; |
| 10276 | var nextProps = workInProgress.pendingProps; |
| 10277 | var prevProps = current !== null ? current.memoizedProps : null; |
| 10278 | |
| 10279 | if (hasLegacyContextChanged()) { |
| 10280 | // Normally we can bail out on props equality but if context has changed |
| 10281 | // we don't do the bailout and we have to reuse existing props instead. |
| 10282 | } else if (memoizedProps === nextProps) { |
| 10283 | var isHidden = workInProgress.mode & AsyncMode && shouldDeprioritizeSubtree(type, nextProps); |
| 10284 | if (isHidden) { |
| 10285 | // Before bailing out, make sure we've deprioritized a hidden component. |
| 10286 | workInProgress.expirationTime = Never; |
| 10287 | } |
| 10288 | if (!isHidden || renderExpirationTime !== Never) { |
| 10289 | return bailoutOnAlreadyFinishedWork(current, workInProgress); |
| 10290 | } |
| 10291 | // If we're rendering a hidden node at hidden priority, don't bailout. The |
| 10292 | // parent is complete, but the children may not be. |
| 10293 | } |
| 10294 | |
| 10295 | var nextChildren = nextProps.children; |
| 10296 | var isDirectTextChild = shouldSetTextContent(type, nextProps); |
| 10297 | |
| 10298 | if (isDirectTextChild) { |
| 10299 | // We special case a direct text child of a host node. This is a common |
| 10300 | // case. We won't handle it as a reified child. We will instead handle |
| 10301 | // this in the host environment that also have access to this prop. That |
| 10302 | // avoids allocating another HostText fiber and traversing it. |
| 10303 | nextChildren = null; |
| 10304 | } else if (prevProps && shouldSetTextContent(type, prevProps)) { |
| 10305 | // If we're switching from a direct text child to a normal child, or to |
| 10306 | // empty, we need to schedule the text content to be reset. |
| 10307 | workInProgress.effectTag |= ContentReset; |
| 10308 | } |
| 10309 | |
| 10310 | markRef(current, workInProgress); |
| 10311 | |
| 10312 | // Check the host config to see if the children are offscreen/hidden. |
| 10313 | if (renderExpirationTime !== Never && workInProgress.mode & AsyncMode && shouldDeprioritizeSubtree(type, nextProps)) { |
| 10314 | // Down-prioritize the children. |
| 10315 | workInProgress.expirationTime = Never; |
| 10316 | // Bailout and come back to this fiber later. |
| 10317 | workInProgress.memoizedProps = nextProps; |
| 10318 | return null; |
| 10319 | } |
| 10320 | |
| 10321 | reconcileChildren(current, workInProgress, nextChildren); |
| 10322 | memoizeProps(workInProgress, nextProps); |
| 10323 | return workInProgress.child; |
| 10324 | } |
no test coverage detected