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

Function prepareUpdate

lib/assets/react-source/development/react.js:11197–11209  ·  view source on GitHub ↗
(domElement, type, oldProps, newProps, rootContainerInstance, hostContext)

Source from the content-addressed store, hash-verified

11195 return shouldAutoFocusHostComponent(type, props);
11196 }
11197 function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
11198 {
11199 var hostContextDev = hostContext;
11200
11201 if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {
11202 var string = '' + newProps.children;
11203 var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
11204 validateDOMNesting(null, string, ownAncestorInfo);
11205 }
11206 }
11207
11208 return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);
11209 }
11210 function shouldSetTextContent(type, props) {
11211 return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
11212 }

Callers 1

react.jsFile · 0.85

Calls 3

updatedAncestorInfoFunction · 0.85
validateDOMNestingFunction · 0.85
diffPropertiesFunction · 0.85

Tested by

no test coverage detected