上一页 1 2 3 4 5 6 ··· 15 下一页
摘要: immer基础介绍 github主页 https://github.com/immerjs/immer 文档 https://immerjs.github.io/immer ##为什么immer让人眼前一亮 immer是一个简单易用的immutable结构生成库,在react的生态里,需要通过imm 阅读全文
posted @ 2022-09-07 18:36 Tommy_marc 阅读(543) 评论(0) 推荐(0) 编辑
摘要: sonar 常见错误结果:https://blog.csdn.net/liuzehn/article/details/121302752 阅读全文
posted @ 2022-08-18 09:53 Tommy_marc 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 一,执行brew官网命令安装brew 官网中复制下图中命令,在terminal中输入该命令,即: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" 输入命 阅读全文
posted @ 2022-08-17 16:08 Tommy_marc 阅读(3961) 评论(0) 推荐(0) 编辑
摘要: #setTimeout、useEffect执行顺序 ##情况1: const App = () => { const [count, setCount] = useState(0) const [total, setTotal] = useState(0) const sayVar = useCal 阅读全文
posted @ 2022-06-23 15:27 Tommy_marc 阅读(928) 评论(0) 推荐(0) 编辑
摘要: 目标效果: obj = { 0: 'a', 1: 'b', 2: 'c' } => arr=['a','b','c'] ####1、Array.from(object) let obj = { 0: 'a', 1: 'b', 2: 'c', length: 3 } let arr = Array.f 阅读全文
posted @ 2022-04-27 14:41 Tommy_marc 阅读(523) 评论(0) 推荐(0) 编辑
摘要: ###方法1: EXFCODE: function isChinese(temp){ var re=/[^\u4E00-\u9FA5]/; if (re.test(temp)) return false ; return true ; } ###方法2: EXFCODE: function isCh 阅读全文
posted @ 2022-04-26 09:05 Tommy_marc 阅读(1428) 评论(0) 推荐(0) 编辑
摘要: ##前言 之前在 React Hook 相关内容 中跟大家提过诸如 useCallback、useMemo 等钩子,其实他与原来 Class 组件时用的 React.PureComponent、shouldComponentUpdate、React.memo 都是密切相关的。 本篇我们就从 useC 阅读全文
posted @ 2022-04-19 17:35 Tommy_marc 阅读(4285) 评论(0) 推荐(1) 编辑
摘要: ##一、React.memo() ####1、React.memo 的使用方式 React.memo() 文档地址:链接 在 class component 时代,为了性能优化我们经常使用 PureComponent,每次对props 进行一次浅比较。当然,除了 PureComponent 外, 我 阅读全文
posted @ 2022-04-19 11:42 Tommy_marc 阅读(359) 评论(0) 推荐(0) 编辑
摘要: ##useReducer介绍 useState 的替代方案,它更适合一些逻辑较复杂且包含多个子值,或者下一个 state 依赖于之前的 state 等的特定场景 类似 Redux 中的功能 reducer。 它接收一个形如 (state, action) => newState 的reducer,并 阅读全文
posted @ 2022-04-19 09:39 Tommy_marc 阅读(151) 评论(0) 推荐(0) 编辑
摘要: ##useCallback介绍 useCallback 可以说是 useMemo 的语法糖,能用 useCallback 实现,都可以用 useMemo,常用语 react 的性能优化。 在 react 中我们经常面临一个子组件渲染优化的问题,尤其是在向子组件传递函数 props 时,每次 rend 阅读全文
posted @ 2022-04-18 16:46 Tommy_marc 阅读(861) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 15 下一页