Typescript 除非'--jsx&x27;旗帜是在我开始时提供的
我做了Typescript 除非'--jsx&x27;旗帜是在我开始时提供的,typescript,node-modules,tsconfig,react-typescript,Typescript,Node Modules,Tsconfig,React Typescript,我做了 我做了纱线开始和http://localhost:3000/很成功,但也有很多问题 出现 $纱线开始也npm运行开始 纱线运行v1.22.4 $react脚本启动 The following changes are being made to your tsconfig.json file: - compilerOptions.jsx must be react-jsx (to support the new JSX transform in React 17) i 「wds」
- 我做了纱线开始和
很成功,但也有很多问题 出现http://localhost:3000/
纱线开始
也npm运行开始
纱线运行v1.22.4
$react脚本启动
The following changes are being made to your tsconfig.json file:
- compilerOptions.jsx must be react-jsx (to support the new JSX transform in React 17)
i 「wds」: Project is running at http://192.168.56.1/
i 「wds」: webpack output is served from
i 「wds」: Content not from webpack is served from C:\Users\taiga\Github\Typescript\eslint-app\example\public
i 「wds」: 404s will fallback to /
Starting the development server...
Compiled successfully!
You can now view example in the browser.
Local: http://localhost:3000
On Your Network: http://192.168.56.1:3000
Note that the development build is not optimized.
To create a production build, use npm run build.
错误
除非提供了'--JSX'标志,否则无法使用JSX
Module./App'已解析为'c:/Users/taiga/Github/Typescript/eslint-App/example/src/App.tsx',但未设置'--jsx'。
- “--jsx”选项的参数必须是:“保留”、“反应本机”、“反应”。
- 使用lint a
react typescript应用程序
- 在使用CRA(创建react应用程序)初始化项目后,它是否正确编译/工作
尝试将“jsx”:“react jsx”放回原处。这是创建react应用程序(CRA)脚本的一个未决问题。唯一适合我的解决方案是在
.env
文件(在项目根目录中)中添加以下配置
- "jsx": "react-jsx"
+ "jsx": "react"
DISABLE_NEW_JSX_TRANSFORM=true