MCPcopy Create free account
hub / github.com/microsoft/SandDance / reconcileSingleTextNode

Function reconcileSingleTextNode

docs/external/js/react-dom.development.js:14278–14296  ·  view source on GitHub ↗
(returnFiber, currentFirstChild, textContent, expirationTime)

Source from the content-addressed store, hash-verified

14276 }
14277
14278 function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {
14279 // There's no need to check for keys on text nodes since we don't have a
14280 // way to define them.
14281 if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
14282 // We already have an existing node so let's just update it and delete
14283 // the rest.
14284 deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
14285 var existing = useFiber(currentFirstChild, textContent);
14286 existing.return = returnFiber;
14287 return existing;
14288 } // The existing first child is not a text node so we need to create one
14289 // and delete the existing ones.
14290
14291
14292 deleteRemainingChildren(returnFiber, currentFirstChild);
14293 var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
14294 created.return = returnFiber;
14295 return created;
14296 }
14297
14298 function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
14299 var key = element.key;

Callers 1

reconcileChildFibersFunction · 0.85

Calls 3

deleteRemainingChildrenFunction · 0.85
useFiberFunction · 0.85
createFiberFromTextFunction · 0.85

Tested by

no test coverage detected