react
dongceha
一枚小鲜肉。努力成长为老腊肉
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Vue2.x 源码中 的 diff 以及 对 key 的使用,以及和 react 之间的区别
一直不想写 vue diff 的过程,因为 这一块网络上讲的人实在是太多了,这里写了也只不过是拾人牙慧罢了,但是不写吧,又觉得心痒痒的,毕竟前面写了一篇 react 的export function isDef (v: any): boolean %checks { return v !== undefined && v !== null}function sameVnode (a, b) { return ( a.key === b.ke...原创 2020-05-29 15:32:21 · 677 阅读 · 0 评论 -
react-redux 源码学习
function createState(reducer) { let state = null; const listeners = []; const subscribe = (listener) => listeners.push(listener); const getState = () => state; const dispatch = (actio...原创 2019-12-06 14:22:19 · 196 阅读 · 0 评论 -
react + mobx 实现基本的 todolist
之前使用 react 都是直接用了 redux ,对于 mobx 也只能说是 久仰久仰,现在有机会了就来试一试mobx 是使用了 proxy 来进行数据 双向绑定的一个库,如果使用过vue 的话,对于里面的部分功能就不会陌生了yarn add mobxyarn add mobx-react由于不想使用装饰器,主要也不想改 react-create-app 里面的 babel 配置,...原创 2019-12-07 14:20:27 · 575 阅读 · 0 评论 -
react hook 中的闭包问题
在 react 中,当父组件向子组件传递一个函数的时候,那个函数中包含一个变量,state ,会产生闭包问题上代码:// 父组件const uploadTable = (props) => { const { uploadingFileList, } = props; const deleteFile = (file) => { const fi...原创 2019-12-20 16:18:33 · 2861 阅读 · 1 评论 -
react 源码中 的 diff 以及 对 key 的使用
无论是在 vue 还是 react 中,使用 key 都是一个 必须面对的问题,最近就对 react 的key 做了一点学习,这里就当做个人的学习笔记了我们就来看这里的 (已删除 多余的代码,只留下了 数组类型的 子节点 )// This API will tag the children with the side-effect of the reconciliation // itself. They will be added to the side-effect list as w原创 2020-05-10 14:03:39 · 739 阅读 · 0 评论
分享