随笔分类 -  React.js

摘要:React (a.k.a. ReactJS or React.js) is a JavaScript library for creating user interfaces, open sourced to the world by Facebook and Instagram team in 2 阅读全文
posted @ 2022-05-28 20:52 zzfx 阅读(53) 评论(0) 推荐(0) 编辑
摘要:1、jsx:语法模型,语句构建模型; 2、组件:集合模型,组件管理; 3、vdom:分层模型、渲染管理模型; 4、flux:管道模型、数据模型,状态管理模型; 整体上是一个UI系统从上到下的构建; flux、redux = mamagerof(componet.status) react = Vir 阅读全文
posted @ 2019-10-21 19:20 zzfx 阅读(600) 评论(0) 推荐(0) 编辑
摘要:// ReactUpdates.js - enqueueUpdate(component) function dirtyComponents.push(component); https://juejin.im/post/5c504f736fb9a049ef26fcd3#heading-3 深入理解 阅读全文
posted @ 2019-10-21 19:12 zzfx 阅读(247) 评论(0) 推荐(0) 编辑
摘要:我们都知道高阶函数是什么, 高阶组件其实是差不多的用法,只不过传入的参数变成了react组件,并返回一个新的组件. A higher-order component is a function that takes a component and returns a new component. 形 阅读全文
posted @ 2019-07-12 16:28 zzfx 阅读(288) 评论(0) 推荐(0) 编辑
摘要:Called to determine whether the change in props and state should trigger a re-render. Component always returns true. PureComponent implements a shallo 阅读全文
posted @ 2019-07-08 14:41 zzfx 阅读(318) 评论(0) 推荐(0) 编辑
摘要:How Does React Native Work? The idea of writing mobile applications in JavaScript feels a little odd. How is it possible to use React in a mobile envi 阅读全文
posted @ 2019-07-05 19:04 zzfx 阅读(287) 评论(0) 推荐(0) 编辑
摘要:面向virtual DOM编程 vs 面向native componet编程; 状态编程引起的UI变化会全部提交到native compnent然后走平台原来的渲染流程。 The DOM is just one of the rendering environments React can rend 阅读全文
posted @ 2019-07-05 18:44 zzfx 阅读(698) 评论(0) 推荐(0) 编辑
摘要:一个node的状态发生变化; 会对当前结点和子节点的数据全部进行更新; 然后进行dom比较; 比较完毕后一次性提交; 相对于以前的渲染方式: 每一个node的数据发生变化,都会产生一次渲染提交; 以上内容为猜测。 阅读全文
posted @ 2019-07-05 18:15 zzfx 阅读(174) 评论(0) 推荐(0) 编辑
摘要:Babel is a JavaScript compiler Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaSc 阅读全文
posted @ 2019-07-05 17:57 zzfx 阅读(296) 评论(0) 推荐(0) 编辑
摘要:概览 组件 使用 React 组件可以将 UI 拆分为独立且复用的代码片段,每部分都可独立维护。你可以通过子类 React.Component 或 React.PureComponent 来定义 React 组件。 React.Component React.PureComponent 如果你不使用 阅读全文
posted @ 2019-06-27 14:37 zzfx 阅读(262) 评论(0) 推荐(0) 编辑
摘要:一、概述 Donovon has created this nice flowchart that explains the new lifecycle of a Hooks component. Comes in handy https://www.bram.us/2019/03/11/react 阅读全文
posted @ 2019-06-27 12:11 zzfx 阅读(531) 评论(0) 推荐(0) 编辑
摘要:将UI组件抽象为状态处理机。分为普通状态和副作用状态。 一、综述 useState:处理函数只改变引用的状态本身;副作用状态:会对引用状态以外的状态和变量进行修改;useReducer:用解藕化的机制进行计算状态维护; 二、useState useState:flux化管理的模块状态(本模块持有)c 阅读全文
posted @ 2019-06-27 11:35 zzfx 阅读(343) 评论(0) 推荐(0) 编辑
摘要:UI—html—DOM(tree-structured representation、 manipulate)—Virtual DOM(component) Real DOM强调树状结构的整体;核心是树状结构的维护; Virtual DOM强调的是组件,核心是组件的构建、组合和维护; Real DO 阅读全文
posted @ 2019-06-26 11:47 zzfx 阅读(459) 评论(0) 推荐(0) 编辑
摘要:react = Virtual DOM + component + data flow + jsx 核心是Virtual DOM结构的状态维护、渲染机制及UI系统的DOM组织功能; 基于Virtual DOM的视图构建和渲染方式。 入口为index.html; 一、虚拟DOM 基于状态管理的UI组件 阅读全文
posted @ 2019-06-26 11:20 zzfx 阅读(147) 评论(0) 推荐(0) 编辑
摘要:这篇文章的全局观和思路一级棒! The Fairy Tale Cast your mind back to 2010 when users started to demand interactive web applications. Back then the only real solution 阅读全文
posted @ 2019-06-25 19:28 zzfx 阅读(225) 评论(0) 推荐(0) 编辑
摘要:In this section, we will discuss some of the features that make React a superior choice for front-end developers. Have a look: Source: http://blog.emb 阅读全文
posted @ 2019-06-25 18:36 zzfx 阅读(511) 评论(0) 推荐(0) 编辑
摘要:If you are using React or learning React, you must have heard of the term “Virtual DOM”. Now what is a Virtual DOM, and why does React use it? Real DO 阅读全文
posted @ 2019-06-25 18:34 zzfx 阅读(289) 评论(0) 推荐(0) 编辑
摘要:Consider a DOM made of thousands of divs. Remember, we are modern web developers, our app is very SPA! We have lots of methods that handle events - cl 阅读全文
posted @ 2019-06-25 18:26 zzfx 阅读(340) 评论(0) 推荐(0) 编辑
摘要:React is a declarative, efficient, and flexible JavaScript library for building user interfaces. It lets you compose complex UIs from small and isolat 阅读全文
posted @ 2019-06-18 11:27 zzfx 阅读(155) 评论(0) 推荐(0) 编辑
摘要:Getting started with react.js: basic concept of React component 1 What is React.js React, or React.js is an open source javascript framework from Face 阅读全文
posted @ 2019-06-18 11:07 zzfx 阅读(149) 评论(0) 推荐(0) 编辑