解决方案

js中问号代表可选项

可选链式操作符

参考链接

https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator

React:TypeError: Cannot read properties of undefined (reading 'map')的更多相关文章

  1. Vue报错: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'protocol')

    Vue报错: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'protocol') 报错信 ...

  2. Error in created hook: "TypeError: Cannot read properties of undefined (reading 'get')"

    写Vue 的时候常遇到的错误之一就是XXXXXX未定义,然后来一个undefined这种问题一般都是创建钩子出错:无法读取未定义的 xxx 属性. 此错误一般多出现在 created() 中, Vue ...

  3. Error in v-on handler: “TypeError: Cannot read properties of undefined (reading ‘resetFields‘)“

    在做vue element 项目中,做了一个新增 打开弹框的功能,想每次点击新增的时候表单项重置.1.使用了this.$refs[formName].resetFields();2.但是报错了,原因是 ...

  4. Vue 报错Error in render: “TypeError: Cannot read properties of null (reading ‘xxx’)” found in

    前端vue报错 [Vue warn]: Error in render: "TypeError: Cannot read properties of null (reading 'name' ...

  5. React Developer插件报错Cannot read properties of undefined (reading ‘forEach‘)

    安装了3.6的版本React Developer 启用插件后 报错 解决 https://www.crx4chrome.com/crx/3068/ 下载 下载好后,直接拖入扩展程序中

  6. [canvas]ncaught TypeError: Cannot read properties of null (reading 'getContext')

    相信你和我一样是直接复制大佬的js代码(笑) ------------ 主要问题在于:js先加载完了,html才加载,导致js获取不了html的对象 解决办法: 把  <head />  ...

  7. webpack逆向之报错Cannot read properties of undefined (reading 'call')

    经典报错 记录一下: 1: 缺少模块    补上 2.主模块无法调用子模块   有可能网站用的数组形式的模块包,你用的是对象,调用方法就要改变. 改写过程中 用的是对象方式: 那么3号包调用的4号包 ...

  8. Cannot read properties of undefined (reading 'toUpperCase')

    无法读取 JS 中未定义的属性"toUpperCase"|鲍比哈兹 (bobbyhadz.com) 根据其中的内容找到了答案:使用了未定义的属性去使用toUpperCase()函数 ...

  9. TypeError: Cannot read property '$$' of undefined at HTMLElement._attached.wx.getPlatform._touchstartHandlerForDevtools

    TypeError: Cannot read property '$$' of undefined     at HTMLElement._attached.wx.getPlatform._touch ...

  10. react / config\webpack.config.js 编译后去掉map 减小体积 shouldUseSourceMap = false

    react / config\webpack.config.js 编译后去掉map 减小体积 shouldUseSourceMap = false

随机推荐

  1. SpringBoot 集成 SpringSecurity + MySQL + JWT 附源码,废话不多直接盘

    SpringBoot 集成 SpringSecurity + MySQL + JWT 无太多理论,直接盘 一般用于Web管理系统 可以先看 SpringBoot SpringSecurity 基于内存 ...

  2. python自产调试工具pdb的使用

    python自产调试工具pdb的使用 介绍 调试打印在写代码的时候不可避免 项目越大,调试可能花的时间会越多 print调试可能是最早用的,一段时间内你都会习惯这种方式 一旦成了老鸟,你应该会去用ID ...

  3. 2022-04-18:things是一个N*3的二维数组,商品有N件,商品编号从1~N, 比如things[3] = [300, 2, 6], 代表第3号商品:价格300,重要度2,它是6号商品的附属

    2022-04-18:things是一个N3的二维数组,商品有N件,商品编号从1~N, 比如things[3] = [300, 2, 6], 代表第3号商品:价格300,重要度2,它是6号商品的附属商 ...

  4. 【C#代码整洁之道】读后习题

    1)劣质的代码会带来什么后果? GPT回答: 可维护性降低:代码过于复杂.难以理解.难以修改,导致维护成本增加,代码质量更加恶化. 可靠性降低:错误容易发生,很难找到并修复,因为代码模糊.逻辑混乱,并 ...

  5. odoo开发教程十:Actions

    actions定义了系统对于用户的操作的响应:登录.按钮.选择项目等. 一:窗口action(ir.actions.act_window ) 最常用的action类型,用于将model的数据展示出来. ...

  6. hello-iot

    iot,internet of things 环境搭建 使用真实环境 Single-board computer - Raspberry Pi Arduino - Wio Terminal 或者虚拟环 ...

  7. 5.5. Java并发工具类(如CountDownLatch、CyclicBarrier等)

    5.5.1 CountDownLatch CountDownLatch是一个同步辅助类,它允许一个或多个线程等待,直到其他线程完成一组操作.CountDownLatch有一个计数器,当计数器减为0时, ...

  8. ShowMeBug 持续升级,提供高信效度支撑的技术招聘方案

    去年年底,全新升级版的 ShowMeBug --一款支持实战编程的技术能力评估平台,首次揭开了它神秘的面纱. 而近日,ShowMeBug 再次迎来一系列产品更新,它将以全新的面貌,提供高信效度支撑的技 ...

  9. 【技术积累】Java中的泛型【一】

    泛型是什么 Java中的泛型是一种能够让用户在编写代码时避免使用明确的类型而进行类型参数化的机制.Java中的泛型可以让编程者在代码编写时不必关心具体类型,只用关心类型之间的关系和相互转换,从而在编写 ...

  10. 洛谷 P9047 [PA2021] Poborcy podatkowi

    题意 给一棵有边权的树,从中选出若干条长度为 4 的路径,要求边不交,求最大权值和. 数据范围:\(1\le n\le 2\times 10^5, -10^9\le w\le 10^9\). 题解 考 ...