Skip to content

Commit 8e4e308

Browse files
kamalkamal
authored andcommitted
Init project
1 parent 9a088bd commit 8e4e308

File tree

1 file changed

+0
-55
lines changed

1 file changed

+0
-55
lines changed

README.md

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,7 @@
1-
# TypeScript Next.js example
2-
3-
This is a really simple project that shows the usage of Next.js with TypeScript.
4-
5-
## Deploy your own
6-
7-
Deploy the example using [Vercel](https://vercel.com):
8-
9-
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/next.js/tree/canary/examples/with-typescript)
10-
11-
## How to use it?
12-
13-
### Using `create-next-app`
14-
15-
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
16-
17-
```bash
18-
npx create-next-app --example with-typescript with-typescript-app
19-
# or
20-
yarn create next-app --example with-typescript with-typescript-app
21-
```
22-
23-
### Download manually
24-
25-
Download the example:
26-
27-
```bash
28-
curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-typescript
29-
cd with-typescript
30-
```
31-
32-
Install it and run:
33-
341
```bash
352
npm install
363
npm run dev
374
# or
385
yarn
396
yarn dev
407
```
41-
42-
Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
43-
44-
## Notes
45-
46-
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.
47-
48-
```
49-
npm install --save-dev typescript
50-
```
51-
52-
To enable TypeScript's features, we install the type declarations for React and Node.
53-
54-
```
55-
npm install --save-dev @types/react @types/react-dom @types/node
56-
```
57-
58-
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.
59-
60-
Next.js has built-in TypeScript declarations, so we'll get autocompletion for Next.js' modules straight away.
61-
62-
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.

0 commit comments

Comments
 (0)