No description
  • TypeScript 86%
  • CSS 12.9%
  • JavaScript 1.1%
Find a file
2021-01-10 21:47:28 +09:00
.vscode fix: select value text color 2021-01-08 09:57:49 +09:00
components 🩹 hover effect on disable button 2021-01-10 21:47:28 +09:00
lib fix: select value text color 2021-01-08 09:57:49 +09:00
pages feat: bot card 2021-01-10 19:26:11 +09:00
styles feat: bot card 2021-01-10 19:26:11 +09:00
types feat: add buttons on bot card 2021-01-10 20:37:23 +09:00
.drone.yml feat: add CI 2021-01-10 20:52:59 +09:00
.gitignore feat: exclude .idea 2021-01-09 09:21:35 +09:00
.prettierrc feat: dropdown 2021-01-06 13:36:03 +09:00
next-env.d.ts feat: re-initialize with typescript 2021-01-06 10:28:34 +09:00
package.json feat: admin badge 2021-01-10 10:47:14 +09:00
postcss.config.js feat: apply tailwindcss 2021-01-06 10:37:17 +09:00
README.md feat: re-initialize with typescript 2021-01-06 10:28:34 +09:00
tailwind.config.js feat: bot card 2021-01-10 19:26:11 +09:00
tsconfig.json feat: re-initialize with typescript 2021-01-06 10:28:34 +09:00
yarn.lock feat: admin badge 2021-01-10 10:47:14 +09:00

TypeScript Next.js example

This is a really simple project that shows the usage of Next.js with TypeScript.

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use it?

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app --example with-typescript with-typescript-app
# or
yarn create next-app --example with-typescript with-typescript-app

Deploy it to the cloud with Vercel (Documentation).

Notes

This example shows how to integrate the TypeScript type system into Next.js. Since TypeScript is supported out of the box with Next.js, all we have to do is to install TypeScript.

npm install --save-dev typescript

To enable TypeScript's features, we install the type declarations for React and Node.

npm install --save-dev @types/react @types/react-dom @types/node

When we run next dev the next time, Next.js will start looking for any .ts or .tsx files in our project and builds it. It even automatically creates a tsconfig.json file for our project with the recommended settings.

Next.js has built-in TypeScript declarations, so we'll get autocompletion for Next.js' modules straight away.

A type-check script is also added to package.json, which runs TypeScript's tsc CLI in noEmit mode to run type-checking separately. You can then include this, for example, in your test scripts.