// react source code exportfunctioncreateElement(type, config, children) { let propName;
// Reserved names are extracted const props = {};
let key = null; let ref = null; let self = null; let source = null; // 省略。。。 returnReactElement( type, key, ref, self, source, ReactCurrentOwner.current, props, ); } // reactElement 创建 constReactElement = function(type, key, ref, self, source, owner, props) { const element = { // This tag allows us to uniquely identify this as a React Element $$typeof: REACT_ELEMENT_TYPE,
// Built-in properties that belong on the element type: type, key: key, ref: ref, props: props,
// Record the component responsible for creating this element. _owner: owner, }; // ...
{ if (namespaceURI === HTML_NAMESPACE) { if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) { warnedUnknownTags[type] = true; warning(false, 'The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type); } } }