🤗
Next.jsでTypeScriptを導入するのは甘えるだけ
Nextjs様に甘えながら,TypeScriptを導入する方法を紹介
Nextjsでは拡張子が.tsx
のファイルを,yarn dev
したときに,検出してくれて,必要なライブラリをインストールするように支持してくれます.最高に優しい.
Please install typescript, @types/react, and @types/node by running:
yarn add --dev typescript @types/react @types/node
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).
ということなので,
yarn add --dev typescript @types/react @types/node
をターミナルに貼り付けて実行して上げれば完了です!最高!
Discussion