MCPcopy Create free account
hub / github.com/plotly/dash / commitPlacement

Function commitPlacement

dash/deps/react-dom@18.3.1.js:23873–23912  ·  view source on GitHub ↗
(finishedWork)

Source from the content-addressed store, hash-verified

23871 }
23872
23873 function commitPlacement(finishedWork) {
23874
23875
23876 var parentFiber = getHostParentFiber(finishedWork); // Note: these two variables *must* always be updated together.
23877
23878 switch (parentFiber.tag) {
23879 case HostComponent:
23880 {
23881 var parent = parentFiber.stateNode;
23882
23883 if (parentFiber.flags & ContentReset) {
23884 // Reset the text content of the parent before doing any insertions
23885 resetTextContent(parent); // Clear ContentReset from the effect tag
23886
23887 parentFiber.flags &= ~ContentReset;
23888 }
23889
23890 var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its
23891 // children to find all the terminal nodes.
23892
23893 insertOrAppendPlacementNode(finishedWork, before, parent);
23894 break;
23895 }
23896
23897 case HostRoot:
23898 case HostPortal:
23899 {
23900 var _parent = parentFiber.stateNode.containerInfo;
23901
23902 var _before = getHostSibling(finishedWork);
23903
23904 insertOrAppendPlacementNodeIntoContainer(finishedWork, _before, _parent);
23905 break;
23906 }
23907 // eslint-disable-next-line-no-fallthrough
23908
23909 default:
23910 throw new Error('Invalid host parent fiber. This error is likely caused by a bug ' + 'in React. Please file an issue.');
23911 }
23912 }
23913
23914 function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
23915 var tag = node.tag;

Callers 1

Calls 5

getHostParentFiberFunction · 0.70
resetTextContentFunction · 0.70
getHostSiblingFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…