08 2021 档案
摘要:长话短说: 1、官网 https://react.docschina.org/docs/context.html 2、优点 Context 提供了一个无需为每层组件手动添加 props,就能在组件树间进行数据传递的方法。 3、问题 Context 主要应用场景在于很多不同层级的组件需要访问同样一些的
阅读全文
摘要:// useReducer 实现 todoList import React,{ useReducer,useRef } from 'react' import './index.less' function todoList() { const inputRef = useRef(); /* ht
阅读全文
摘要:记录学习的文章,参考 回顾 在介绍一下这两个hooks的作用之前,我们先来回顾一下react中的性能优化。在hooks诞生之前,如果组件包含内部state,我们都是基于class的形式来创建组件。当时我们也知道,react中,性能的优化点在于: 1、调用setState,就会触发组件的重新渲染,无论
阅读全文
摘要:接上文: https://www.cnblogs.com/-roc/p/15102866.html 续 1、安装 cnpm install @better-scroll/core --save cnpm install @better-scroll/pull-up --save cnpm insta
阅读全文
摘要:git https://gitee.com/mirrors/better-scroll/ 1.x 文档 https://better-scroll.github.io/docs-v1/doc/zh-hans/ 2.x文档 https://better-scroll.github.io/docs/zh
阅读全文
摘要:如果你使用create-react-app创建项目,执行命令 yarn build 后,直接以静态方式打开build文件夹内的index.html,会看到页面显示出现问题,打开console后会看到js、css、svg等文件的路径出现问题。 解释: 在打包之前,在 package.json 中 pr
阅读全文
摘要:1、 npm i redux-persist --save 2、store/index import { createStore, combineReducers } from 'redux'; import reducers from './reducers/index'; import {per
阅读全文

浙公网安备 33010602011771号