📘
【Next.js】@types/reactが認識されない場合の対応方法
概要
@types/react 18.0.2
をインストールしたが認識されない事象があったので対処方法をまとめる
It looks like you're trying to use TypeScript but do not have the required package(s) installed.
Please install @types/react by running:
yarn add --dev @types/react
If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your pages directory).
@types/react
をダウングレードする
issues
の通りだが18.0.2
にバグがあるらしくダウングレードすることで正常化するとのこと
npm install --save-dev @types/react@18.0.1
Discussion