🤗

Next.jsでTypeScriptを導入するのは甘えるだけ

2020/11/22に公開

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