From c8c3e48abd4bb93febf2c94b1b5fdb4f8738540e Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 3 Jan 2019 15:38:20 +0000 Subject: [PATCH] Update adding-typescript.md --- docusaurus/docs/adding-typescript.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docusaurus/docs/adding-typescript.md b/docusaurus/docs/adding-typescript.md index 7d6a61ed..d67cee32 100644 --- a/docusaurus/docs/adding-typescript.md +++ b/docusaurus/docs/adding-typescript.md @@ -10,17 +10,21 @@ title: Adding TypeScript To start a new Create React App project with [TypeScript](https://www.typescriptlang.org/), you can run: ```bash -$ npx create-react-app my-app --typescript -$ # or -$ yarn create react-app my-app --typescript +npx create-react-app my-app --typescript + +# or + +yarn create react-app my-app --typescript ``` To add [TypeScript](https://www.typescriptlang.org/) to a Create React App project, first install it: ```bash -$ npm install --save typescript @types/node @types/react @types/react-dom @types/jest -$ # or -$ yarn add typescript @types/node @types/react @types/react-dom @types/jest +npm install --save typescript @types/node @types/react @types/react-dom @types/jest + +# or + +yarn add typescript @types/node @types/react @types/react-dom @types/jest ``` Next, rename any file to be a TypeScript file (e.g. `src/index.js` to `src/index.tsx`) and **restart your development server**!