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

Function commitMount

dash/deps/react-dom@18.2.0.js:11027–11054  ·  view source on GitHub ↗
(domElement, type, newProps, internalInstanceHandle)

Source from the content-addressed store, hash-verified

11025 });
11026 } // -------------------
11027 function commitMount(domElement, type, newProps, internalInstanceHandle) {
11028 // Despite the naming that might imply otherwise, this method only
11029 // fires if there is an `Update` effect scheduled during mounting.
11030 // This happens if `finalizeInitialChildren` returns `true` (which it
11031 // does to implement the `autoFocus` attribute on the client). But
11032 // there are also other cases when this might happen (such as patching
11033 // up text content during hydration mismatch). So we'll check this again.
11034 switch (type) {
11035 case 'button':
11036 case 'input':
11037 case 'select':
11038 case 'textarea':
11039 if (newProps.autoFocus) {
11040 domElement.focus();
11041 }
11042
11043 return;
11044
11045 case 'img':
11046 {
11047 if (newProps.src) {
11048 domElement.src = newProps.src;
11049 }
11050
11051 return;
11052 }
11053 }
11054 }
11055 function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
11056 // Apply the diff to the DOM node.
11057 updateProperties(domElement, updatePayload, type, oldProps, newProps); // Update the props handle so that we know which props are the ones with

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…