Skip to content

Added additional information on creating new projects with Typescript support #5866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ cd my-app
npm start
```

.. or with typescript support (available with `[email protected]` and higher):

```sh
npx create-react-app my-app --typescript
cd my-app
npm start
```

_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_

Then open [http://localhost:3000/](http://localhost:3000/) to see your app.<br>
Expand Down Expand Up @@ -62,6 +70,10 @@ yarn create react-app my-app

_`yarn create` is available in Yarn 0.25+_

### Adding typescript support

To add [TypeScript](https://www.typescriptlang.org/) support when creating a new project, add the --typescript parameter to any of the methods above. e.g. `npx create-react-app my-app --typescript` for npx, `npm init react-app my-app --typescript' for npm or `yarn create react-app my-app --typescript` for yarn.

It will create a directory called `my-app` inside the current folder.<br>
Inside that directory, it will generate the initial project structure and install the transitive dependencies:

Expand Down
12 changes: 12 additions & 0 deletions docusaurus/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ cd my-app
npm start
```

.. or with typescript support (available with `[email protected]` and higher):

```sh
npx create-react-app my-app --typescript
cd my-app
npm start
```

_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_

Then open [http://localhost:3000/](http://localhost:3000/) to see your app.
Expand Down Expand Up @@ -60,6 +68,10 @@ yarn create react-app my-app

_`yarn create` is available in Yarn 0.25+_

### Adding typescript support

To add [TypeScript](https://www.typescriptlang.org/) support when creating a new project, add the --typescript parameter to any of the methods above. e.g. `npx create-react-app my-app --typescript` for npx, `npm init react-app my-app --typescript' for npm or `yarn create react-app my-app --typescript` for yarn.

## Output

Running any of these commands will create a directory called `my-app` inside the current folder. Inside that directory, it will generate the initial project structure and install the transitive dependencies:
Expand Down