![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
React
MeSKiL
这个作者很懒,什么都没留下…
展开
-
JSX到JavaScript的转换
React(1) JSX通过babel转换为JavaScript// jsx语法代码function Test(){ return <p>123</p>}<Test id="test" name="divName"> <span>span 1</span> <a>a 2</a></Tes...原创 2019-10-09 11:36:02 · 443 阅读 · 0 评论 -
ReactElement
React系列(2) ReactElementReact.createElement做了什么先判断config中内置props(key,ref,self,source)存在且有效,则赋值给新声明的变量再将config中非内置的props 给新声明的props(key和ref不会跟其他config中的变量一起被处理,而是单独作为变量出现在ReactElement上。)判断如果孩子节点为一个...原创 2019-10-09 14:45:27 · 1906 阅读 · 0 评论 -
ReactComponent
React系列(3) ReactComponentreact/src/ReactBaseClasses.jsfunction Component(props, context, updater) { this.props = props; this.context = context; // If a component has string refs, we will ass...原创 2019-10-09 19:03:00 · 148 阅读 · 0 评论