摘要: 在 React 18 中,严格模式(StrictMode)会导致组件在开发模式下执行两次。这是为了帮助开发者检测潜在的问题和副作用。 严格模式的作用 严格模式是一个用于突出显示应用程序中潜在问题的工具。它不会渲染任何可见的 UI,而是为其后代元素触发额外的检查和警告 严格模式的主要作用包括: 检测不 阅读全文
posted @ 2025-03-29 22:26 奔付山河 阅读(180) 评论(0) 推荐(0)
摘要: 1.set函数会触发函数组件重新渲染,所以如果在渲染的过程中使用set函数会触发死循环 function Home() { const [x, setX] = useState(0) // 会触发死循环 setX(x + 1) return <div>{ x }</div> } 2.set函数是异步 阅读全文
posted @ 2025-03-29 22:11 奔付山河 阅读(23) 评论(0) 推荐(0)
摘要: 关注的博客 王垠的博客 catcoding laruence 编程语言 Crafting “Crafting Interpreters” 在线学习网站 rust在线练习 阅读全文
posted @ 2024-04-15 22:03 奔付山河 阅读(11) 评论(0) 推荐(0)
摘要: error: could not amend shell profile: '/Users//.profile': could not write rcfile file: '/Users//.profile': Permission denied (os error 13) error: coul 阅读全文
posted @ 2024-04-03 13:39 奔付山河 阅读(777) 评论(0) 推荐(0)
摘要: visual studio code安装 vim 插件后不能响应长按,比如按下 j 键,光标不能持续向下。 Mac系统的问题,在终端中输入下面命令即可: defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false 阅读全文
posted @ 2024-04-03 11:16 奔付山河 阅读(137) 评论(0) 推荐(0)
摘要: capslock -> ctrl // system key change inoremap jj <Esc> // esc config to jk let mapleader = " " // leader to space Verbs d: delete c: change y: yank ( 阅读全文
posted @ 2024-04-02 20:54 奔付山河 阅读(52) 评论(0) 推荐(0)
摘要: qglobal.h __cplusplus //判断是否是c++编译器 include <type_traits> // [https://learn.microsoft.com/zh-cn/cpp/standard-library/type-traits?view=msvc-170] includ 阅读全文
posted @ 2024-04-02 17:41 奔付山河 阅读(43) 评论(0) 推荐(0)
摘要: Mac下brew安装mysql sudo mysql.server start报错 Starting MySQL .Logging to '/usr/local/var/mysql/192.168.0.102.err'. .. ERROR! The server quit without updat 阅读全文
posted @ 2024-02-04 21:42 奔付山河 阅读(11) 评论(0) 推荐(0)
摘要: mac qt安装 mac qt安装 国内镜像地址 下载的dmg启动后无法安装 系统偏好与设置->安全与隐私->通用->允许从以下位置安装选择仍要打开 debug启动控制台输出版本问题 程序坞出现图标但是不显示窗体 Project WARNING: Qt has only been tested wi 阅读全文
posted @ 2024-01-05 12:12 奔付山河 阅读(121) 评论(0) 推荐(0)
摘要: endl;//会刷新设备缓冲区 2.1.2类型转换 wchar_t//确保可以存放机器最大字符集的任意一个字符 char16_t char32_t//Unicode字符集服务 unsigned char c = -1;//255 超出显示范围 初始值对无符号类型表示总数取模后的余数 signed c 阅读全文
posted @ 2023-12-31 23:31 奔付山河 阅读(19) 评论(0) 推荐(0)