reactjs - 您可能需要一个额外的加载器来处理这些加载器的结果。是由 OR 分配引起的
问题描述
在我的 Typescript React 代码中:
return changed ||= false
使用运算符时,我不断收到此错误||=
(我认为来自 webpack)
Module parse failed: Unexpected token (85:8)
File was processed with these loaders:
* ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
* ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| checkParams.forEach(param => {
> return changed ||= false;
| });
当我删除||=
操作员时,错误消失了
return changed = changed | false
为什么会这样?
解决方案
推荐阅读
- discord - discord.py 嵌入对象函数 add_field 参数 inline=True 不适用于移动设备?
- javascript - Alfresco 的高级定制
- ruby-on-rails - Rails - 从单独的控制器和表单编辑多个模型
- json - 如何将字符串转换为 json vb.net
- apache - 为 Apache Tomcat 7 构建 HTTP 安全标头过滤器
- android - Android camera2 createCaptureRequest 在获取 YUV_420_888 图像时返回所有黑色像素
- angular - Angular 中 MatDiaLog 的关闭按钮获取错误无法读取 null 的属性“关闭”
- elasticsearch - 过滤一组关键字中的关键字
- python - 创建一个包含子字典的字典作为新值,索引为键
- php - 无法使用 PDO 从数据库类中回显行,获取“ArgumentCountError”