如何停止jsx
运行开发服务器时,NextJS 将属性从“ react ”覆盖到“保留”?
我的 tsconfig.json
文件:
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"exclude": [
"node_modules"
],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
]
}
AFAIK jsx 选项必须是
react
编译我的 tsx
文件到 jsx
.
最佳答案
在这里回答:
https://github.com/kulshekhar/ts-jest/issues/937
本质上,您扩展了当前的 tsconfig.json
有一个专门用于开玩笑,然后引用 tsconfig.json
来自您的 jest.config.js
.
关于reactjs - Next.js、TypeScript 和 tsconfig.json 'jsx' 属性被覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61973940/