随笔分类 - React
React的相关学习记录和问题记录等
摘要:
Next.js项目报错:Uncaught TypeError: Cannot read properties of undefined (reading 'forEach')
阅读全文

摘要:React中memo和useMemo的对比
阅读全文
摘要:1. 通过回调函数 <SomeComponent ref={thisComp => this.yourCompRef = thisComp} /> 2. 通过createRef函数 const currentRef = React.createRef(); <SomeComponent ref={c
阅读全文
摘要:在 Create React App 工程中样式使用less modules
阅读全文
摘要:个人所负责的一个项目,需要兼容IE11,所以已经按照react-app-polyfill官方指定的方案进行兼容配置即在项目src/index.js中: // The first lines in src/index.js import 'react-app-polyfill/ie11'; impor
阅读全文
摘要:避免create-react-app的项目在build的过程中生成 .map 文件的方法:主要是更改 package.json 里面的 build 命令!正式进入修改步骤前,推荐安装 cross-env 包,可以解决平台兼容问题!步骤一、打开package.json文件,找到"scripts"标签处
阅读全文
摘要:一般使用方法: 传递默认参数: 参数reducer会默认为defaultState的值
阅读全文