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

Function commitMount

lib/assets/react-source/development/react.js:11232–11242  ·  view source on GitHub ↗
(domElement, type, newProps, internalInstanceHandle)

Source from the content-addressed store, hash-verified

11230 var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;
11231 var noTimeout = -1; // -------------------
11232 function commitMount(domElement, type, newProps, internalInstanceHandle) {
11233 // Despite the naming that might imply otherwise, this method only
11234 // fires if there is an `Update` effect scheduled during mounting.
11235 // This happens if `finalizeInitialChildren` returns `true` (which it
11236 // does to implement the `autoFocus` attribute on the client). But
11237 // there are also other cases when this might happen (such as patching
11238 // up text content during hydration mismatch). So we'll check this again.
11239 if (shouldAutoFocusHostComponent(type, newProps)) {
11240 domElement.focus();
11241 }
11242 }
11243 function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
11244 // Update the props handle so that we know which props are the ones with
11245 // with current event handlers.

Callers 1

commitLifeCyclesFunction · 0.85

Calls 1

Tested by

no test coverage detected