ReactElement算是React源码中比较简单的部分了,直接看源码: var ReactElement = function(type, key, ref, self, source, owner, props) { var element = { // This tag allow us to uniquely identify this as a React Element $$typeof: REACT_ELEMENT_TYPE, // Built-in properties tha…
2019-11-06 1.最重要的两个目录,react,react-dom,(react-reconciler后续会很重要) 2.使用flow检查js的类型 3.react.createElement(type, props, children) 4.createElement 源码在ReactElement.js里,最终会 return element = { // This tag allows us to uniquely identify this as a React Elem…