なぜそれが見つからないのか分かりません。typescript: 'react'モジュールが見つかりません
$ cat tsconfig.json
{
"compilerOptions": {
"sourceMap": true,
"target": "es6",
"jsx": "react",
"types": [
"lodash",
"react",
"react-dom"
]
}
}
$ tree node_modules/@types
node_modules/@types/
├── lodash
│ ├── README.md
│ ├── index.d.ts
│ ├── package.json
│ └── types-metadata.json
├── react
│ ├── README.md
│ ├── index.d.ts
│ ├── package.json
│ └── types-metadata.json
└── react-dom
├── README.md
├── index.d.ts
├── package.json
├── server.d.ts
└── types-metadata.json
コンポーネントファイルでのインポート。
// src/components/component.tsx
import * as React from "react";
何が得られますか?
どのように反応をインポートしようとしていますか? –
あなたは 'import react = require(" react ");'を試したことがありますか? –
'--traceResolution'で実行された出力は参考になります –