MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / reconcileSingleTextNode

Function reconcileSingleTextNode

code/styling/public/app.js:9534–9551  ·  view source on GitHub ↗
(returnFiber, currentFirstChild, textContent, expirationTime)

Source from the content-addressed store, hash-verified

9532 }
9533
9534 function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {
9535 // There's no need to check for keys on text nodes since we don't have a
9536 // way to define them.
9537 if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
9538 // We already have an existing node so let's just update it and delete
9539 // the rest.
9540 deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
9541 var existing = useFiber(currentFirstChild, textContent, expirationTime);
9542 existing['return'] = returnFiber;
9543 return existing;
9544 }
9545 // The existing first child is not a text node so we need to create one
9546 // and delete the existing ones.
9547 deleteRemainingChildren(returnFiber, currentFirstChild);
9548 var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
9549 created['return'] = returnFiber;
9550 return created;
9551 }
9552
9553 function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
9554 var key = element.key;

Callers 1

reconcileChildFibersFunction · 0.70

Calls 3

deleteRemainingChildrenFunction · 0.70
useFiberFunction · 0.70
createFiberFromTextFunction · 0.70

Tested by

no test coverage detected