随笔分类 - React
实现自定义react hooks
摘要:1:实现简版的 useState 每次调用顺序索引必须一样返回初始状态变量,和更改状态方法调用更改状态方法,更新状态并重新渲染let lastStates = []let index;function useState(initValue) { let state = lastStates[inde
阅读全文
实现简版redux和中件间
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content
阅读全文
React循环链表结构js实现
摘要:const queue = { pending: null }; function dispatchAction(action, queue) { const update = { action: action, next: null }; if (queue.pending == null) {
阅读全文
React i18n多语言实现
摘要:目前比较流行的三种方式react-i18nextreact-intlreact-intl-universa what is react-i18next?react-i18next is a powerful internationalization framework for React / Rea
阅读全文
react note
摘要:React用于构建用户界面的javascript库特性 声明性 learn once组件函数组件(无状态组件)类组件(有状态组件) 组件通讯父->子子->父兄弟组件EventEmitter 组件的生命周期 事件绑定this指向 箭头函数Function.prototype.bind()类的实例函数
阅读全文
浙公网安备 33010602011771号