我用的是类型记录和react。在src文件夹中创建tsx文件时,类型记录正在工作。但是每当我在像ex这样的子文件夹中使用tsx。“组件”文件夹类型记录无法工作。
tsconfig.json:
{"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx" }, "include": ["src"] }发布于 2022-07-13 06:08:44
查看新生成的tsconfig
用于网页
npx创建反应应用程序我的应用程序模板类型记录
反应本机
npx反应-本机init MyApp -模板反应本机模板类型
检查顶部导入的dir,当使用vscode时,当您键入组件名称时,还有一个自动建议功能
希望它能帮上忙
https://stackoverflow.com/questions/72961601
复制相似问题