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

Function createInstance

lib/assets/react-source/development/react.js:11168–11189  ·  view source on GitHub ↗
(type, props, rootContainerInstance, hostContext, internalInstanceHandle)

Source from the content-addressed store, hash-verified

11166 selectionInformation = null;
11167 }
11168 function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
11169 var parentNamespace;
11170
11171 {
11172 // TODO: take namespace into account when validating.
11173 var hostContextDev = hostContext;
11174 validateDOMNesting(type, null, hostContextDev.ancestorInfo);
11175
11176 if (typeof props.children === 'string' || typeof props.children === 'number') {
11177 var string = '' + props.children;
11178 var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
11179 validateDOMNesting(null, string, ownAncestorInfo);
11180 }
11181
11182 parentNamespace = hostContextDev.namespace;
11183 }
11184
11185 var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
11186 precacheFiberNode(internalInstanceHandle, domElement);
11187 updateFiberProps(domElement, props);
11188 return domElement;
11189 }
11190 function appendInitialChild(parentInstance, child) {
11191 parentInstance.appendChild(child);
11192 }

Callers 1

completeWorkFunction · 0.85

Calls 5

validateDOMNestingFunction · 0.85
updatedAncestorInfoFunction · 0.85
precacheFiberNodeFunction · 0.85
updateFiberPropsFunction · 0.85
createElementFunction · 0.70

Tested by

no test coverage detected