react 沉思录
react = Virtual DOM + component + data flow + jsx 核心是Virtual DOM结构的状态维护、渲染机制及UI系统的DOM组织功能 ? 一、虚拟DOM 基于状态管理的UI组件化技术 at its core it’s made up of functional components,with clear direction on how to manage state properly. ?
https://www.cnblogs.com/feng9exe/p/11084600.html ? 二、component status/propts 生命周期管理; 状态管理; 渲染: const element = <h1>Hello,world</h1>; .(,.()); 事件; ? 三、jsx React发明了JSX,利用HTML语法来创建虚拟DOM。 当遇到<,JSX就当HTML解析,遇到{就当JavaScript解析。 ? render() { ? ? return React.createElement( ? ? ? "div", ? ? ? null, ? ? ? "Hello ", ? ? ? this.props.name ? ? ); ? } ? render() { ? ? return ( ? ? ? <div> ? ? ? ? Hello {this.props.name} ? ? ? </div> ? ? ); } ? ? 四、架构模式—MVC模式 While React is the ‘V’ in the MVC structure,Flux fills in the?‘M’ and ‘C’ components. ReactJS?In the simple and popular term,React is the V (View) in MVC (Model/View/Controller). ? 五、数据流
? ? 六、依赖库管理 package node install x (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |