TypeScript
Next.js provides a TypeScript-first development experience for building your React application.
It comes with built-in TypeScript support for automatically installing the necessary packages and configuring the proper settings.
As well as a TypeScript Plugin for your editor.
🎥 Watch: Learn about the built-in TypeScript plugin → YouTube (3 minutes)
New Projects
create-next-app now ships with TypeScript by default.
Terminal npx create-next-app@latest
Existing Projects
Add TypeScript to your project by renaming a file to .ts / .tsx. Run next dev and next build to automatically install the necessary dependencies and add a tsconfig.json file with the recommended config options.
If you already had a jsconfig.json file, copy the paths compiler option from the old jsconfig.json into the new tsconfig.json file, and delete the old jsconfig.json file.
TypeScript Plugin