随笔分类 -  React

React的相关学习记录和问题记录等
摘要:关于Next.js项目启动后页面空白(控制台报错)问题的排查Next.js项目报错:Uncaught TypeError: Cannot read properties of undefined (reading 'forEach') 阅读全文
posted @ 2022-05-08 16:59 樊顺 阅读(848) 评论(0) 推荐(0) 编辑
摘要:React中memo和useMemo的对比 阅读全文
posted @ 2022-03-14 21:03 樊顺 阅读(772) 评论(0) 推荐(0) 编辑
摘要:1. 通过回调函数 <SomeComponent ref={thisComp => this.yourCompRef = thisComp} /> 2. 通过createRef函数 const currentRef = React.createRef(); <SomeComponent ref={c 阅读全文
posted @ 2020-11-29 13:09 樊顺 阅读(225) 评论(0) 推荐(0) 编辑
摘要:在 Create React App 工程中样式使用less modules 阅读全文
posted @ 2020-11-24 10:53 樊顺 阅读(2617) 评论(1) 推荐(0) 编辑
摘要:个人所负责的一个项目,需要兼容IE11,所以已经按照react-app-polyfill官方指定的方案进行兼容配置即在项目src/index.js中: // The first lines in src/index.js import 'react-app-polyfill/ie11'; impor 阅读全文
posted @ 2020-01-11 11:05 樊顺 阅读(2879) 评论(0) 推荐(0) 编辑
摘要:避免create-react-app的项目在build的过程中生成 .map 文件的方法:主要是更改 package.json 里面的 build 命令!正式进入修改步骤前,推荐安装 cross-env 包,可以解决平台兼容问题!步骤一、打开package.json文件,找到"scripts"标签处 阅读全文
posted @ 2019-07-15 14:19 樊顺 阅读(2044) 评论(1) 推荐(1) 编辑
摘要:一般使用方法: 传递默认参数: 参数reducer会默认为defaultState的值 阅读全文
posted @ 2018-12-28 21:19 樊顺 阅读(1872) 评论(0) 推荐(0) 编辑
摘要:React,this 阅读全文
posted @ 2018-11-29 22:03 樊顺 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-11-16 11:46 樊顺 阅读(2059) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示