プロジェクトのルートに.compilerc
があり、text/typescript
MIMEタイプのTypeScriptコンパイラオプションが定義されていることを確認してください。 TypeScriptコンパイラオプションには、"jsx": "react"
オプションが含まれている必要があります。ここで
は私の.compilerc
です:
{
"env": {
"development": {
"application/javascript": {
"presets": ["es2016-node5", "react"],
"sourceMaps": "inline"
},
"text/typescript":{
"target": "es6",
"module": "commonjs",
"sourceMap":true,
"inlineSourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"allowJs": true,
"jsx": "react"
}
},
"production": {
"application/javascript": {
"presets": ["es2016-node5", "react"],
"sourceMaps": "none"
},
"text/typescript":{
"target": "es6",
"module": "commonjs",
"sourceMap":false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"allowJs": true,
"jsx": "react"
}
}
}
}