MCPcopy Create free account
hub / github.com/reactjs/react-rails / reconcileSingleTextNode

Function reconcileSingleTextNode

lib/assets/react-source/development/react.js:17838–17856  ·  view source on GitHub ↗
(returnFiber, currentFirstChild, textContent, expirationTime)

Source from the content-addressed store, hash-verified

17836 }
17837
17838 function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {
17839 // There's no need to check for keys on text nodes since we don't have a
17840 // way to define them.
17841 if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
17842 // We already have an existing node so let's just update it and delete
17843 // the rest.
17844 deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
17845 var existing = useFiber(currentFirstChild, textContent);
17846 existing.return = returnFiber;
17847 return existing;
17848 } // The existing first child is not a text node so we need to create one
17849 // and delete the existing ones.
17850
17851
17852 deleteRemainingChildren(returnFiber, currentFirstChild);
17853 var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
17854 created.return = returnFiber;
17855 return created;
17856 }
17857
17858 function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
17859 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