![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
react
aeipyuan
渣渣一枚,请多指教。。。。。。
展开
-
Fiber学习
生成virtual DOM树 bable转换jsx的结果 let style = { border: "1px solid orange", margin: "5px" } let element = ( <div id="A1" style={style}> A1 <div id="B1" style={style}> B1 <div id="C1" style={style}>C1</div> <div id="C原创 2020-05-29 15:59:41 · 159 阅读 · 0 评论 -
react-router理解
react-router理解 1. Provider和Consumer Provider和Comsumer是React提供的两个原生组件,Provider的value属性传递数据,Provider包裹内的所有Consumer都可以直接获取到Provider的数据 获取方法 let { Provider, Consumer } = React.createContext(); 使用方法 <Provider value={{ name: "aeipyuan" }}> <div>原创 2020-05-13 10:16:24 · 614 阅读 · 1 评论 -
实现一个简易版的react
实现一个简易版的react React.createElement 作用:将babel解析的结果转换成树形结构 class Element { constructor(type, props) { this.type = type; this.props = props; } } function createElement(type, props, ...children) { props = props || {}; props.chil原创 2020-05-12 13:46:56 · 161 阅读 · 0 评论