如何在tsx中导入jsx文件,

问题描述 投票:0回答:1

enter image description here

将 jsx 文件导入 tsx 文件时显示红线。

要解决此问题,只需在 tsconfig.json 文件中添加

"allowJs": true,

tsconfig.json

  "compilerOptions": {
    "allowJs": true,
  },

我试图将 app.jsx 文件导入 main.tsx

reactjs import jsx tsx
1个回答
0
投票

现在,我的答案就清楚了,只需添加 ```compilerOptions": { “allowJs”:正确, },

in tsconfig.json
© www.soinside.com 2019 - 2024. All rights reserved.