我有一个自定义节点模块,已添加到我的 React 项目中。当我从模块导入组件并运行应用程序时,它返回错误:
Compiled with problems:
ERROR in ./node_modules/react-quick-reactions/src/components/QuickReactions.tsx 4:29
Module parse failed: Unexpected token (4:29)
File was processed with these loaders:
* ./node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
| import { PopoverProps } from "../types/types";
|
> const QuickReactions = (props: PopoverProps) => {
| const {
| isVisible = false,
Run Code Online (Sandbox Code Playgroud)
我试图找到类似的问题,但其他人遇到了无效合并运算符的问题,这些运算符不在问题行上,更不用说在文件中使用了。模块的文件:
import { useMemo, useState } from "react";
import { PopoverProps } from "../types/types";
const QuickReactions = (props: PopoverProps) => …Run Code Online (Sandbox Code Playgroud)