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

Function reconcileSingleTextNode

code/new-context-api/public/app.js:8895–8912  ·  view source on GitHub ↗
(returnFiber, currentFirstChild, textContent, expirationTime)

Source from the content-addressed store, hash-verified

8893 }
8894
8895 function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {
8896 // There's no need to check for keys on text nodes since we don't have a
8897 // way to define them.
8898 if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
8899 // We already have an existing node so let's just update it and delete
8900 // the rest.
8901 deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
8902 var existing = useFiber(currentFirstChild, textContent, expirationTime);
8903 existing['return'] = returnFiber;
8904 return existing;
8905 }
8906 // The existing first child is not a text node so we need to create one
8907 // and delete the existing ones.
8908 deleteRemainingChildren(returnFiber, currentFirstChild);
8909 var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
8910 created['return'] = returnFiber;
8911 return created;
8912 }
8913
8914 function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
8915 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